solved Problem 3