    modifier takeFees() {
        uint256 managementFee = accruedManagementFee();
        uint256 totalFee = managementFee + accruedPerformanceFee();
        uint256 currentAssets = totalAssets();
        uint256 shareValue = convertToAssets(1e18);

        if (shareValue > highWaterMark) highWaterMark = shareValue;

        if (managementFee > 0) feesUpdatedAt = block.timestamp;

        if (totalFee > 0 && currentAssets > 0)
            _mint(feeRecipient, convertToShares(totalFee));

        _;
    }
function accruedManagementFee() public view returns (uint256) {
        uint256 managementFee = fees.management;
        return
            managementFee > 0
                ? managementFee.mulDiv(
                    totalAssets() * (block.timestamp - feesUpdatedAt),
                    SECONDS_PER_YEAR,
                    Math.Rounding.Down
                ) / 1e18
                : 0;
    }
                       Change fee to 2
                              |
                              v            Collect fees with
  Fee = 0                   Fee = 2        managementFee = 2
    |                         |                    |
    v                         v                    v
  -----------------------------------------------------
    ^                         ^                    ^
    |                         |                    |
| Day 0                     Day 5                 Day 7 |
|                                                       |
+-------------------------------------------------------+
                     Period of time of fees
                     collected with
                     management fee = 2
                            Change fee to 2
                                  |
                                  v            Collect fees with
      Fee = 0                   Fee = 2        managementFee = 2
        |                         |                    |
        v                         v                    v
      -----------------------------------------------------
        ^                         ^                    ^
        |                         |                    |
    | Day 0                     Day 5                 Day 7 |
    |                             |                         |
    +-----------------------------+-------------------------+
       Period of time of fees        Period of time of fees
       collected with                collected with
       management fee = 0            management fee = 2
