Wrote a proper state machine for handling the touch events
Corrected typo