AutomationState added

and some comment added