Rich's solution.