dbscan implementation using kdtree