Working KD-Tree
merged