"args" was being referenced as a global. Changed so it passes a new variable to relevant functions

I made this edit on github's editor, so I haven't actually tested it.