More changes to KMC, incorporated cosine similarity as determinant of distance