fsm and doc