function buyTokens(address beneficiary) public payable {
            require(beneficiary != 0x0);
            require(validPurchase());

            uint256 weiAmount = msg.value;
            weiCrowded = weiCrowded.add(weiAmount);

            
            
            uint256 rRate = rewardRate();
            uint256 rewardBIX = weiAmount.mul(rRate);
            uint256 baseBIX = weiAmount.mul(baseExchangeRate);

            
             uint256 bixAmount = baseBIX.add(rewardBIX);
           
            
            if(rewardBIX > (earlyExchangeRate - baseExchangeRate)) {
                uint releaseTime = startTime + (60 * 60 * 24 * 30 * 3);
                bixToken.mintBIX(beneficiary, baseBIX, rewardBIX, releaseTime);  
            } else {
                bixToken.mintBIX(beneficiary, bixAmount, 0, 0);  
            }
            
            TokenPurchase(msg.sender, beneficiary, weiAmount, bixAmount);
            forwardFunds();           
      }