simple example of FSM