Added State Machine