added sorting for summary data