Peter's solution.