```\n    function _addLiquidity(\n        address token,\n        uint256 tokenDesired,\n        uint256 wethDesired,\n        uint256 tokenMin,\n        uint256 wethMin,\n        GoatTypes.InitParams memory initParams\n    ) internal returns (uint256, uint256, bool) {\n        GoatTypes.LocalVariables_AddLiquidity memory vars;\n        GoatV1Pair pair = GoatV1Pair(GoatV1Factory(FACTORY).getPool(token));\n        if (address(pair) == address(0)) {\n            // First time liquidity provider\n            pair = GoatV1Pair(GoatV1Factory(FACTORY).createPair(token, initParams));\n            vars.isNewPair = true;\n        }\n\n        if (vars.isNewPair) {\n// rest of codeSNIP\n        } else {\n            /**\n             * @dev This block is accessed after the presale period is over and the pool is converted to AMM\n             */\n       (uint256 wethReserve, uint256 tokenReserve) = pair.getReserves();\n       uint256 tokenAmountOptimal = GoatLibrary.quote(wethDesired, wethReserve, tokenReserve);\n       if (tokenAmountOptimal <= tokenDesired) {\n           if (tokenAmountOptimal < tokenMin) {\n               revert GoatErrors.InsufficientTokenAmount();\n           }\n           (vars.tokenAmount, vars.wethAmount) = (tokenAmountOptimal, wethDesired);\n       } else {\n           uint256 wethAmountOptimal = GoatLibrary.quote(tokenDesired, tokenReserve, wethReserve);\n           assert(wethAmountOptimal <= wethDesired);\n           if (wethAmountOptimal < wethMin) revert GoatErrors.InsufficientWethAmount();\n           (vars.tokenAmount, vars.wethAmount) = (tokenDesired, wethAmountOptimal);\n       }\n   }\n   return (vars.tokenAmount, vars.wethAmount, vars.isNewPair);\n    }\n```\n