Part 1 of homework 6.
Part 2 of homework 6.