helper ( n - connected classes )