DBSCAN code