reworked to use jmp_env