added minimum size for connected components