changes to the javasctipt code