Making the javascript work