Added debounce for tactile switch. Cleaned state machine.