cleaned up the global variables