add non locals to function
minor fix + cleanup
Merge pull request #19 from frabbit/genpy

work on python