Sorting for html output