Commented rest of undoCounter function