Added generator.h function