solution to Problem 22