prob22 solution