first version of generator class