small alterations to js