added comments to javascript