kdtree instead of naive neighbors tree