A tiny finite state machine in amber