function to amortize level payment loans