An easy solution to my problem (saying it here to remember it tomorrow): make it so that variables with no superscript are in local scope, just like before (including input/output), and variables with explicit superscripts are global. That way my example above with iterate would work normally, and you can access global variables (requires explicitely using superscripts every time though, but it's better than no global variables at all)