a demo of fsm