function buy(address _recipient) public payable {
        
        
        
        require(_recipient != address(0x0));

		
		
        require(msg.value >= 10 ** 17);

		
		
        require(active);

		

        require(progress == 0 || progress == 1);

		
		
        require(block.timestamp >= start);

		
		
        require(block.timestamp < finish);
		
		

        require((! restricted) || whitelist[msg.sender]);
        
        

        require((! restricted) || whitelist[_recipient]);
        
        

        uint256 baseTokens = safeMul(msg.value, pricer);
        
        
        
        uint256 totalTokens = safeAdd(baseTokens, safeDiv(safeMul(baseTokens, getBonusPercentage()), 100));

		
		
        require(safeAdd(tokens, totalTokens) <= size);
        
        

        if (! participants[_recipient]) {
            participants[_recipient] = true;
            participantIndex.push(_recipient);
        }
        
        

        participantTokens[_recipient] = safeAdd(participantTokens[_recipient], totalTokens);
        participantValues[_recipient] = safeAdd(participantValues[_recipient], msg.value);

		

        tokens = safeAdd(tokens, totalTokens);
        value = safeAdd(value, msg.value);
        
        

        Bought(msg.sender, _recipient, totalTokens, msg.value);
    }