tweaked generator script