function buy( address recipient ) payable public returns(uint){
        require( tx.gasprice <= maxGasPrice );
        require( tx.gasprice >= minGasPrice );

        require( ! haltSale );
        require( saleStarted() );
        require( ! saleEnded() );

        uint mincap = contributorMinCap(recipient);

        uint maxcap = checkMaxCap(recipient, msg.value );
        uint allowValue = msg.value;
        require( mincap > 0 );

        require( maxcap > 0 );
        
        require (msg.value >= mincap);
        
        if(now <= openSaleStartTime + 2 * 24 * 3600) {
            if( msg.value > maxcap ) {
                allowValue = maxcap;
                
                msg.sender.transfer( msg.value.sub( maxcap ) );
            }
        }
       

        
        sendETHToMultiSig(allowValue);
        raisedWei = raisedWei.add( allowValue );
        
        uint recievedTokens = allowValue.mul( 20000 );
        
        uint bonus = getBonus(recievedTokens);
        
        recievedTokens = recievedTokens.add(bonus);
        assert( token.transfer( recipient, recievedTokens ) );
        

        Buy( recipient, recievedTokens, allowValue, bonus );

        return msg.value;
    }