intermediate changes to dbscan to support cosine metric as well