variables in function not connected to variables in script, don't know how to do globals like python, prolly have to pass it in