working on hw5 ex5.