Udapted web.js for hw part1