small working tutorial for FSM