Added caching of 10NN results from cosine.