Implemented mouse click counting and program states.