Hi, in kdtree.hpp and node.hpp very often sqrt is used. d = sqrt(d); if (d <= __max) ... __max itself is also a sqrt()ed value IMHO, the speed could be improved if that is omitted everywhere. Just comparing the squared distances should work if the specified ranges are converted once at the interface methods. wr