added a few comments to generation.js