updated the javascript portion