function pay(uint index, uint256 _amount, address _from) public returns (bool) {
        Loan storage loan = loans[index];
        require(loan.status == Status.lent);
        addInterest(index);
        uint256 toPay = min(getPendingAmount(index), _amount);

        loan.paid = safeAdd(loan.paid, toPay);
        if (getPendingAmount(index) == 0) {
            TotalPayment(index);
            loan.status = Status.paid;
        }

        uint256 transferValue = safeMult(toPay, getOracleRate(index));
        require(token.transferFrom(msg.sender, this, transferValue));
        loan.lenderBalance = safeAdd(transferValue, loan.lenderBalance);
        totalLenderBalance = safeAdd(transferValue, totalLenderBalance);
        PartialPayment(index, msg.sender, _from, toPay);

        return true;
    }