Begin of the Finite State Machine.