removed one call of connected_components