Passing variables to the correct places...

Data needed to be sent through a number of functions in order to reach its destination (hence why it was a global being used instead of just pass by reference in the first place...)