flatten arrays