added a method to cluster same lines