Flatten a set of arrays