function buyTokens(address beneficiary) public payable {
        require(beneficiary != 0x0);
        require(validPurchase());
        require(!hasEnded());
        uint256 weiAmount = msg.value;
        uint256 tokens;
        

        if (block.timestamp >= time0 && block.timestamp < time2) tokens = weiAmount.mul(11000);
        else if (block.timestamp >= time3 && block.timestamp < time7) tokens = weiAmount.mul(10000);

        
        weiRaised = weiRaised.add(weiAmount);
        token.mint(beneficiary, tokens);
        addNewHolder(beneficiary);
        TokenPurchase(msg.sender, beneficiary, weiAmount, tokens, block.timestamp);
        forwardFunds();
    }