flatten directories