Add sort function for slists