Finished hw6 part2.