gen.js modified