added stuff for clustering the detected lines