Some work on the JavaScript