solution for problem 98