JS hw2 complete