Completed the written part of the sample solution.