Adding kd-tree base implementation