made changes to js to match convention