clean up the app.js application and add comments