added missing semicolons and fixed a bit of formatting
added some comments and renamed root.js to web.js for a better picture