Completed adding comments to the javascript

Completed adding comments to the javascript