Moved script from key.html into generator.js