inserted explicit dynamic scope to make the backtrack function point at the correct stable continuation on the stack, should consider using dynamic scope elsewhere instead of implicits? need to figure out if true dynamic scope is preferable to implicit lexical scope here