Cleaned up the JS - sorta