adding  sort functionality
adding  sort functionality