A Finite State Machine