solving the problem 22