Add sort routine