for problem 22