Finished the generator code