Added Problem 3 solution