Flattened the data array so that groups for each row aren't necessary.