Revised of AG_generation

Revised AG_Generation