diff --git a/w2v-server.pl b/w2v-server.pl
index 6c6d6d8..0487d71 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -421,7 +421,8 @@
   return;
 }
 
-void *getCollocators(knnpars *pars) {
+void *getCollocators(void *args) {
+  knnpars *pars = args;
 	int N = pars->N;
   int cc = pars->wl->wordi[0];
 	knn *nbs = NULL;
@@ -556,7 +557,8 @@
   return(wl);
 }
  
-void *_get_neighbours(knnpars *pars) {
+void *_get_neighbours(void *arg) {
+  knnpars *pars = arg;
 	char *st1 = pars->token;
 	int N = pars->N;
 	long from = pars -> from;
@@ -695,7 +697,7 @@
   }
   printf("Waiting for para threads to join\n");
   fflush(stdout);
-  for (a = 0; a < para_threads; a++) pthread_join(pt[a], &para_nbs[a]);
+  for (a = 0; a < para_threads; a++) pthread_join(pt[a], (void *) &para_nbs[a]);
   printf("Para threads joint\n");
   fflush(stdout);
 
@@ -783,7 +785,7 @@
   if (M2) {
     printf("Waiting for syn threads to join\n");
     fflush(stdout);
-    for (a = 0; a < syn_threads; a++) pthread_join(pt[a+para_threads], &syn_nbs[a]);
+    for (a = 0; a < syn_threads; a++) pthread_join(pt[a+para_threads], (void *) &syn_nbs[a]);
  for (a = 0; a <= syn_threads; a++)			printf("window pos: %d, sum: %f\n", a, window_sums[a]);
     printf("syn threads joint\n");
     fflush(stdout);
@@ -796,18 +798,18 @@
 		
 		float best_window_sum[MAX_NEIGHBOURS];
     int found_index=0, i=0, j, w;
-    if(sort_by != 1 && sort_by != 2) { // sort by auto focus mean
-      for(a=0; a < syn_threads; a++) {
-        for(b=0; b < syn_nbs[a]->length; b++) {
-					for(i=0; i < found_index; i++)
-						if(best[i].wordi == syn_nbs[a]->best[b].wordi)
-							break;
-					if(i >= found_index) {
-						best[found_index++].wordi = syn_nbs[a]->best[b].wordi;
-//						printf("found: %s\n", &vocab[syn_nbs[a]->index[b] * max_w]);
-					}
+    for(a=0; a < syn_threads; a++) {
+      for(b=0; b < syn_nbs[a]->length; b++) {
+				for(i=0; i < found_index; i++)
+					if(best[i].wordi == syn_nbs[a]->best[b].wordi)
+						break;
+				if(i >= found_index) {
+					best[found_index++].wordi = syn_nbs[a]->best[b].wordi;
+					//						printf("found: %s\n", &vocab[syn_nbs[a]->index[b] * max_w]);
 				}
 			}
+		}
+    if(sort_by != 1 && sort_by != 2) { // sort by auto focus mean
 			printf("window: %d  -  syn_threads: %d, %d\n", window, syn_threads, (1 << syn_threads) -1);
 			int wpos;
 			for(i=0; i < found_index; i++) {
@@ -855,7 +857,25 @@
 //				printf("found: %s - sum: %f - window: %d\n", &vocab[best[i].wordi * max_w], best[i].activation, best[i].position);
 //			}
 
-    } else if(sort_by ==1) { // single window position
+    } else if(sort_by == 1) { // responsiveness any window position
+			int wpos;
+			for(i=0; i < found_index; i++) {
+ 					float word_window_sum = 0, word_activation_sum = 0, total_window_sum = 0;
+					for(a=0; a < syn_threads; a++) {
+							wpos = (a >= window? a+1 : a);
+						  for(b=0; b < syn_nbs[a]->length; b++)
+							  if(best[i].wordi == syn_nbs[a]->best[b].wordi) {
+                  best[i].probability += syn_nbs[a]->best[b].probability;
+									if(syn_nbs[a]->best[b].activation > 0.25)
+									  best[i].position |= 1 << wpos;
+									if(syn_nbs[a]->best[b].activation > best[i].activation) {
+										best[i].activation = syn_nbs[a]->best[b].activation;
+                  }
+								}
+					}
+			}
+			qsort(best, found_index, sizeof(collocator), cmp_activation);
+     } else if(sort_by == 2) { // single window position
        for(a=1; a < syn_threads; a++) {
         for(b=0; b < syn_nbs[a]->length; b++) {
           for(c=0; c < MAX_NEIGHBOURS; c++) {
@@ -916,7 +936,7 @@
     hv_store(result, "syntagmatic", strlen("syntagmatic"), newRV_noinc((SV*)array), 0);
   }
 end:
-	words = old_words;
+  words = old_words;
 	free(best);
 	return newRV_noinc((SV*)result);
 }
