added comments to the javascript