FSM how do they work