Added findClosestMatch helper