created aeinitiate loop and aecreate function