Added creation of flattened list