renamed some methods, added event listeners for square state change to keep track of the flag count.