added soln for Problem 3