Debugging the global variable problem...