```\nif (unstakeAmount > totalPendingUnstake) {\n pool.receiveWithoutActivation{value: unstakeAmount - totalPendingUnstake}();\n unstakeAmount = totalPendingUnstake;\n}\n\ntotalPendingUnstake -= unstakeAmount;\ntotalUnstaked += unstakeAmount;\nuint256 amountToFill = unstakeAmount;\n\nfor (uint256 i = unstakeRequestCurrentIndex; i <= unstakeRequestCount; i++) {\n UnstakeRequest storage request = \_unstakeRequests[i];\n if (amountToFill > (request.amount - request.amountFilled)) {\n amountToFill -= (request.amount - request.amountFilled);\n continue;\n } else {\n if (amountToFill == (request.amount - request.amountFilled) && i < unstakeRequestCount) {\n unstakeRequestCurrentIndex = i + 1;\n } else {\n request.amountFilled += uint128(amountToFill);\n unstakeRequestCurrentIndex = i;\n }\n break;\n }\n}\n```\n