cleaned up and added comments to app.js.