Have the kdtree code working.