Update main.js: Comments added and formatted.