Updated app.js and associated code samples