solved Problem 31