function finalize() onlyOwner() {

        if (crowdsaleClosed) revert();
        
        uint daysToRefund = 4*60*24*10;  

        if (block.number < endBlock && GXCSentToETH < maxCap -100 ) revert();  
                                                                                 
                                                                                 

        if (GXCSentToETH < minCap && block.number < safeAdd(endBlock , daysToRefund)) revert();   

       
        if (GXCSentToETH > minCap) {
            if (!multisigETH.send(this.balance)) revert();  
            if (!gxc.transfer(team,  gxc.balanceOf(this))) revert(); 
            gxc.unlock();    
        }
        else{
            if (!gxc.burn(this, gxc.balanceOf(this))) revert();  
        }

        crowdsaleClosed = true;
        
    }