Move uniqueAllValsSorted functions to main widget