rewritten the result-dictionary passing code
support for globals

now done properly with support for the python 'global' keyword