helpers sort and search complete