Problem 7: complete solution.