KDTree implementation in C#