Sorting works generically