intermediate flatten