solution to Problem 16