much better generator.h