first version of kdtree
wrong
kd tree