Updated web.js - coursera assignment 8