updated with comments in app.js