first working version of the generator