This seems to be changing from the previous logic. Before we were doing: 1) check if there are duplicates 2) if no duplicate, then process

Now we're doing: 1) start processing 2) as soon as we see a duplicate, we stop processing.

I think the previous way was better.