Replaced findNaiveNearestNeighbor with findNearestNeighbor, that takes a “threshold”. The use of the threshold is the same as in findNaiveNearestNeighbor, and there is now a switch to turn thresholding on and off.