Initial duff JavaScript file in desparate need of a tidy