Added new code to the javascript