function _repay(
        address from,
        address to,
        uint256 part
    ) internal returns (uint256 amount) {
        (totalBorrow, amount) = totalBorrow.sub(part, true);
        userBorrowPart[to] -= part;

        uint256 toWithdraw = (amount - part); //acrrued
        // @audit-issue Takes more fees than it should
        uint256 toBurn = amount - toWithdraw;
        yieldBox.withdraw(assetId, from, address(this), amount, 0);
        //burn USDO
        if (toBurn > 0) {
            IUSDOBase(address(asset)).burn(address(this), toBurn);
        }

        emit LogRepay(from, to, amount, part);
    }
// Penrose contract
bigBangEthDebtRate = 1e17;

// BigBang contract
borrowOpeningFee;
//uint256 amount;
(totalBorrow, amount) = totalBorrow.sub(part, true);
userBorrowPart[to] -= part;

uint256 toWithdraw = (amount - part); //acrrued
// @audit-issue Takes more fees than it should
uint256 toBurn = amount - toWithdraw;
yieldBox.withdraw(assetId, from, address(this), amount, 0);
//burn USDO
if (toBurn > 0) {
   IUSDOBase(address(asset)).burn(address(this), toBurn);
}
yieldBox.withdraw(assetId, from, address(this), amount, 0);
if (toBurn > 0) {
   IUSDOBase(address(asset)).burn(address(this), toBurn);
}
uint256 toWithdraw = (amount - part); //acrrued
uint256 toBurn = amount - toWithdraw;
elastic = Total token amount to be repayed by borrowers, base = Total parts of the debt held by borrowers.
TIME = 0

First borrower A asks 1,000 units, state:

part[A] = 1000
total.part = 1000
total.elastic = 1000


TIME = 1 YEAR

part[A] = 1000 --> no change from borrower A
total.part = 1000 --> no change yet 
total.elastic = 1100 --> fees accrued in one year 100 units

Second borrower B asks 1,000 units, state:

part[B] = 909.09
total.part = 1909.09
total.elastic = 2100

B part was computed as:

1000 * 1000 / 1100 = 909.09

TIME = 2 YEAR

Fees are accrued, hence:

total.elastic = 2100 * 1.1 = 2310.

Hence the total fees accrued by the protocol are:

2310 - 2000 = 310.

These 310 are collected from A and B in the following proportions:

A Fee = 210
B Fee = 100

Borrower B produced 100 units of fees, which makes sense, he asked for 1000 units at 10%/year. 
