Update loan calculation algorithm