modifications to the javascript