some of part b problem 2 done . . .