Implemented debounce fsm