problem 3; hw6 done