Fix the checking for duplicates and also check that you are not being matched
with yourself.