Implement the generator.