kdTree: Working version1.0