Calculation of depreciation