fix bug in amortization