Modified a bit of the global variables, to allow me to peek into the state of the program while running isCM in a subthread.