my simple implementation of KD tree without using Shogun