Didn't deal with "ungrouped" data previously.  Generalized logic to account for that here.