kdtree cleanup