function buyTokens() public payable {
        require(block.timestamp > startWhitelist && block.timestamp < startWhitelist.add(periodWhitelist));


        if (indCap > 0) {
            require(msg.value <= indCap.mul(1 ether));
        }

        require(whitelist[msg.sender]);
        uint256 totalAmount = msg.value.mul(1 ether).mul(10^8).div(rate).add(msg.value.mul(1 ether).mul(10**8).mul(bonuses1).div(100).div(rate));
        uint256 balance = token.balanceOf(this);

        if (totalAmount > balance) {
            uint256 cash = balance.mul(rate).mul(100).div(100 + bonuses1).div(10**8).div(1 ether);
            uint256 cashBack = msg.value.sub(cash);
            multisig.transfer(cash);
            msg.sender.transfer(cashBack);
            token.transfer(msg.sender, balance);
            emit Purchased(msg.sender, balance, "WhiteList");
            return;
        }

        multisig.transfer(msg.value);
        token.transfer(msg.sender, totalAmount);
        emit Purchased(msg.sender, totalAmount, "WhiteList");
    }