function buy(address _recipient) public payable
        validSale
        validAddress(_recipient)
        returns(uint256)
    {
        
        uint256 weiContributionAllowed = eligibleAmountCheck(_recipient, msg.value);
        require(weiContributionAllowed > 0);

        
        uint256 tokensRemaining = token.balanceOf(address(this));
        require(tokensRemaining > 0);

        
        uint256 receivedTokens = weiContributionAllowed.mul(rate);

        
        
        if (receivedTokens > tokensRemaining) {
            receivedTokens = tokensRemaining;
            weiContributionAllowed = tokensRemaining.div(rate);
        }

        
        assert(token.transfer(_recipient, receivedTokens));

        
        sendETHToMultiSig(weiContributionAllowed);
        raisedWei = raisedWei.add(weiContributionAllowed);

        
        
        if (msg.value > weiContributionAllowed) {
            msg.sender.transfer(msg.value.sub(weiContributionAllowed));
        }

        
        Buy(_recipient, receivedTokens, weiContributionAllowed);

        return weiContributionAllowed;
    }