Added my solution to Problem 3.