code: function sortByLabel(a, b) {
      if (a.sortval > b.sortval) return -1;
      else if (a.sortval == b.sortval) return 0;
      else return 1;
    }
docs: Sort by label
  
  Will sort descending by the label specified
  Use the reverse flag or function for ascending results