A KD-tree library