Cleaned up a bit and did dbscan splitting