Small changes to the Javascript