Added comments to js code