moved all the JS to a separate file