finite state machine logic svg