Reduced the number of globals needed and restructured the manual command state of the program to not rely on flags as much. Reduces the debuggin complexity immensely