Uploading Nick D's KNN file

One quick comment for the moment: can you write this without a `for` loop? (Vectorize!)