Updated the signature of checkCandBestMatch, now passing the current best match distance to avoid recomputation