refactored so the gamemodes don't have to call global variables