completed FSM for 2 states.