Added most of the JS