changed app.js to object style