Adding problem #4 solution.