final code for web.js