function buyTokens(address _to) public
    whilePresale
    isWhitelisted (_to)
    payable {
        uint256 weiAmount = msg.value;
        uint256 tokens = weiAmount * presaleRate;
        weiRaised = weiRaised.add(weiAmount);
        presaleWallet.transfer(weiAmount);
        if (!token.transferFromPresale(_to, tokens)) {
            revert();
        }
        emit TokenPurchase(_to, weiAmount, tokens);
    }