updated the JS to include other functionality