kdtree implementation faster now