Added the case for CTRL + z being pressed if the it the active window, and changed the time the undocounter function is run
Fixed formatting