Updated and simplified Javascript and JSON