added doc comments to js