FSM now working