Cleaned up stringsort code