Some mucking around with KD Tree