implement kNN algorithm in c#