Moving the javascript into a separate file