creation of generator