Cleaned up the JS, ready to work with JSON