Modified script so that summary table is sortable