i hate these globals.  need to restructure code a bit (and rename the walk_scope1/2 functions)