solved Problem 47