Implemented the generator