corrected generator script