That's what I was thinking.

I also changed the implementation a bit. My way was buggy since it would raise whenever there was duplicates and a `name` was in `names` (even if `name` wasn't duplicated). But I want it to only raise when `name` is one of the duplicates.