Modified fsm.