         allMatches = getMultiSearch(currentSearch)
         while !(isMatchDataLoaded()) {}
         allMatches = sortByRank(allMatches)
+        matchAvg = 0
+        maxMatchRank = -1
+        for match in allMatches {
+            matchAvg += match.rank
+            if match.rank > maxMatchRank {
+                maxMatchRank = match.rank
+            }
+        }
+        matchAvg /= Double(allMatches.count)
         matches = allMatches
         animateTableViewCellsToLeft(tableView)
         tableView.reloadData()

        } else {
            allMatches = addToSearch(allMatches, newIngredient: currentSearch.last!)
            while !(isMatchDataLoaded()) {}
            allMatches = sortByRank(allMatches)
            matches = allMatches
            tableView.reloadData()
        }

        
        if !(matches.isEmpty) {
            let match = matches[indexPath.row].ingredient
            let matchRank = matches[indexPath.row].rank // not in use for now
            let matchesPerLevel = Int(matches.count / MATCH_COLORS.count)
            let matchLevel = Int((matches.count - indexPath.row)/matchesPerLevel)

            if match.isDataAvailable() {
                cell.label.text = match[_s_name] as? String
            } else {
