flattened array method done