Attempting to take out that global variables -- slowly