Added Problem 4's solution.