flattening of array alloc