merge flatten