```\n  function repay(uint256 repayAmount, uint256 _userLoanId) external {\n    Loan memory userLoan = loans[msg.sender][_userLoanId];\n    if(userLoan.borrowedAmount < repayAmount) revert ExcessiveRepay();\n    if(block.timestamp > userLoan.endDate) revert LoanExpired();\n    uint256 interestLoanRatio = FixedPointMathLib.divWad(userLoan.interest, userLoan.borrowedAmount);\n    uint256 interest = FixedPointMathLib.mulWadUp(repayAmount, interestLoanRatio);\n    outstandingDebt -= repayAmount - interest > outstandingDebt ? outstandingDebt : repayAmount - interest;\n    loans[msg.sender][_userLoanId].borrowedAmount -= repayAmount;\n    loans[msg.sender][_userLoanId].interest -= interest;\n    poolSize += userLoan.interest * (1000 - (multisigShare + apdaoShare)) / 1000; //@audit should use interest instead of userLoan.interest\n// rest of code\n  }\n```\n