added code to layout.ejs and app.js, well commented.