added function generator