Added flatten