converting to get_gas_usage function