removing overlapping matches