Solution for problem 44