Updating some of the JS code