modify nearMatchSearch a bit