FSM Generator