revised app.js