reworked app.js