function refund(uint gas) internal
    {
        uint amount = (gas-msg.gas+36120) * tx.gasprice;
        
        if (goo[msg.sender] < amount && goo[msg.sender] > 0)
        {
            amount = goo[msg.sender];
        }
        
        if (goo[msg.sender] >= amount)
        {
            goo[msg.sender] -= amount;
            
            msg.sender.transfer(amount);
        }
    }