added some stuling and comments to main.js