step 3 flatten
step 4 flatten
step 5 flatten
merge
step 6 flatten