Added minimum cosine similarity and k thresholds