add state machine diagram