function buyTokens(address beneficiary) public payable {
    require(beneficiary != address(0));
    require(stage !=0);
    require(validPurchase(false));
    if(stage == 1) {
      require(msg.value >= 10 ether);
    }

    if(stage == 2) {
      require(msg.value >= 1 ether);
    }
    
    uint256 weiAmount = msg.value;

    uint256 tokens = getTokenAmount(weiAmount);

    
    weiRaised = weiRaised.add(weiAmount);

    token.mint(beneficiary, tokens);
    TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);

    forwardFunds();
  }