Added State Machine.