document fsm functions