added comments to code in index.js