function buyTokens(address beneficiary) public payable {
    require(beneficiary != 0x0);
    require(validPurchase());
    uint256 weiAmount = msg.value;
    
    uint256 tokens = (weiAmount.mul(getRate())).div(10 ** uint256(10));
    
    require(transferIfTokenAvailable(tokens, weiAmount, beneficiary));
    
    weiRaised = weiRaised.add(weiAmount);
    
    forwardFunds();
  }