Update main.js with comments