HW 06 solution.