Add sort functionality.