Added auto state machine states and function skeleton