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

        if (block.timestamp >= time0 && block.timestamp < time1) tokens = weiAmount.mul(1000).div(65);
        else if (block.timestamp >= time1 && block.timestamp < time2) tokens = weiAmount.mul(1000).div(70);
        else if (block.timestamp >= time2 && block.timestamp < time3) tokens = weiAmount.mul(1000).div(75);
        else if (block.timestamp >= time3 && block.timestamp < time4) tokens = weiAmount.mul(1000).div(80);
        else if (block.timestamp >= time4 && block.timestamp < time5) tokens = weiAmount.mul(1000).div(85);
        else if (block.timestamp >= time5 && block.timestamp < time6) tokens = weiAmount.mul(1000).div(90);
        else if (block.timestamp >= time6 && block.timestamp < time7) tokens = weiAmount.mul(1000).div(95);

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