Added useful comments to the javascript file