major update to gas.py