Calculating the mortgage balance