function buyTokens(address beneficiary) payable {
      require (!isFinalized);
      require (block.timestamp >= fundingStartTimestamp || preallocationsWhitelist.whitelist(msg.sender));
      require (block.timestamp <= fundingEndTimestamp);
      require (msg.value != 0);
      require (beneficiary != 0x0);
      require (tx.gasprice <= gasPriceLimit);

      uint256 tokens = msg.value.mul(tokenExchangeRate); 
      uint256 checkedSupply = token.totalSupply().add(tokens);
      uint256 checkedBought = bought[msg.sender].add(tokens);

      
      require (checkedBought <= whiteList.whitelist(msg.sender) || preallocationsWhitelist.whitelist(msg.sender));

      
      require (tokenCreationCap >= checkedSupply);

      
      
      require (tokens >= minBuyTokens || (tokenCreationCap - token.totalSupply()) <= minBuyTokens);

      token.mint(beneficiary, tokens);
      bought[msg.sender] = checkedBought;
      CreateRCN(beneficiary, tokens);  

      forwardFunds();
    }