Another KD-Tree implementation