Add sort functionality