Updated reshuffled logic to remove matches.