Added doc to some of the javascript