problem 22 solution