solved problem 47