DBSCAN implemantation