Adding problem #6 solution.