added commentaries to main.js