implemented DBSCAN algorithm