Update app.js

Major changes to app.js