improving fsm