Modification of the degree clustering algorithm