thresh-elimination modified to properly allow sets of matches.