Solution for problem 94