With this function you can calculate the depreciation.