function buyTokens(address beneficiary) 
    nonZeroEth 
    tokenIsDeployed 
    onlyPublic 
    nonZeroAddress(beneficiary) 
    payable 
    returns(bool) 
    {
        require(msg.value >= minAmount);

        require(now >= IcoStartDate && now <= IcoEndDate);
        fundTransfer(msg.value);

        uint256 amount = numberOfTokens(getCurrentExchangeRate(), msg.value);
            
        if (token.transfer(beneficiary, amount)) {
            IcoTotalTokensSold = IcoTotalTokensSold.add(amount);
            WeiRaised = WeiRaised.add(msg.value);
            TokenPurchase(beneficiary, msg.value, amount);
            return true;
        } 

    return false;
       
    }