add kd tree WIP