A very tasty state machine