solution to Problem 21