core MISC
global goes the root level code. nonlocal goes to the upper level. You should use a separate line to claim the variable.