Added test for output of sorted averages