Added Problem 6's solution.