Added Nearest and NearestInSpan functions