A simple, reactive, finite state machine