altered js exercise and added dependencies