added moore fsm