This happens to work for the examples we gave, but it doesn't actually do what was described in the comments.