Added agent state concept