implement flatten_merge, flatten, flatten!