needs to be refactored and merged with makeLoanRepayment