add fsm example code