Add sort-by-column functionality