Completed hw6 part2.