diff --git a/R/collocationAnalysis.R b/R/collocationAnalysis.R
index fc9d814..64e0c83 100644
--- a/R/collocationAnalysis.R
+++ b/R/collocationAnalysis.R
@@ -44,8 +44,7 @@
 #' @inheritParams collocationScoreQuery,KorAPConnection-method
 #' @return Tibble with top collocates, association scores, corresponding URLs for web user interface queries, etc.
 #'
-#' @importFrom stringr str_match str_split str_detect
-#' @importFrom dplyr anti_join arrange desc slice_head bind_rows
+#' @importFrom dplyr arrange desc slice_head bind_rows
 #' @importFrom purrr pmap
 #' @importFrom tidyr expand_grid
 #'
@@ -224,6 +223,74 @@
 }
 
 #' @importFrom magrittr debug_pipe
+#' @importFrom stringr str_detect
+#' @importFrom dplyr as_tibble tibble rename filter anti_join tibble bind_rows case_when
+#'
+matches2FreqTable <- function(matches,
+                              index = 0,
+                              minOccur = 5,
+                              leftContextSize = 5,
+                              rightContextSize = 5,
+                              ignoreCollocateCase = FALSE,
+                              stopwords = c(),
+                              collocateFilterRegex =  '^[:alnum:]+-?[:alnum:]*$',
+                              oldTable = data.frame(word = rep(NA, 1), frequency = rep(NA, 1)),
+                              verbose = TRUE) {
+  word <- NULL # https://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check
+  frequency <- NULL
+
+  if (nrow(matches) < 1) {
+    dplyr::tibble(word=c(), frequency=c())
+  } else if (index == 0) {
+    if (! "tokens" %in% colnames(matches) || ! is.list(matches$tokens)) {
+      log_info(verbose, "Outdated KorAP server: Falling back to client side tokenization.\n")
+      return(snippet2FreqTable(matches$snippet, minOccur, leftContextSize, rightContextSize, ignoreCollocateCase = ignoreCollocateCase,
+                        stopwords = stopwords, oldTable = oldTable, verbose = verbose))
+
+    }
+    log_info(verbose, paste("Joining", nrow(matches), "kwics\n"))
+    for (i in 1:nrow(matches)) {
+      oldTable <- matches2FreqTable(
+        matches,
+        i,
+        leftContextSize = leftContextSize,
+        rightContextSize = rightContextSize,
+        collocateFilterRegex = collocateFilterRegex,
+        oldTable = oldTable,
+        stopwords = stopwords
+      )
+    }
+    log_info(verbose, paste("Aggregating", length(oldTable$word), "tokens\n"))
+    oldTable  %>%
+      group_by(word) %>%
+      mutate(word = dplyr::case_when(ignoreCollocateCase ~ tolower(word), TRUE ~ word)) %>%
+      summarise(frequency=sum(frequency), .groups = "drop") %>%
+      arrange(desc(frequency))
+  } else {
+    stopwordsTable <- dplyr::tibble(word=stopwords)
+
+    left <- tail(unlist(matches$tokens$left[index]), leftContextSize)
+
+#    cat(paste("left:", left, "\n", collapse=" "))
+
+    right <- head(unlist(matches$tokens$right[index]), rightContextSize)
+
+#    cat(paste("right:", right, "\n", collapse=" "))
+
+    if(length(left) + length(right) == 0) {
+      oldTable
+    } else {
+      table(c(left, right)) %>%
+        dplyr::as_tibble(.name_repair = "minimal") %>%
+        dplyr::rename(word = 1, frequency = 2) %>%
+        dplyr::filter(str_detect(word, collocateFilterRegex)) %>%
+        dplyr::anti_join(stopwordsTable, by="word")  %>%
+        dplyr::bind_rows(oldTable)
+    }
+  }
+}
+
+#' @importFrom magrittr debug_pipe
 #' @importFrom stringr str_match str_split str_detect
 #' @importFrom dplyr as_tibble tibble rename filter anti_join tibble bind_rows case_when
 #'
@@ -411,7 +478,8 @@
       tibble(word=c(), frequency=c())
     } else {
       q <- fetchNext(q, maxFetch=searchHitsSampleLimit, randomizePageOrder=TRUE)
-      snippet2FreqTable((q@collectedMatches)$snippet,
+      matches2FreqTable (q@collectedMatches,
+                         0,
                         minOccur = minOccur,
                         leftContextSize = leftContextSize,
                         rightContextSize = rightContextSize,
