updates for more careful gas management
bootstrapped with fixes for repl depth