added some comments to main.js