diff -r -u -X .ignore gnugo-copy/engine/globals.c gnugo/engine/globals.c
--- gnugo-copy/engine/globals.c	2006-12-31 16:44:44.734375000 +0100
+++ gnugo/engine/globals.c	2006-12-31 16:45:13.375000000 +0100
@@ -133,8 +133,6 @@
 float black_score;
 
 /* Close worms data. See liberty.h */
-int close_worms[BOARDMAX][MAX_CLOSE_WORMS];
-int number_close_worms[BOARDMAX];
 int close_black_worms[BOARDMAX][MAX_CLOSE_WORMS];
 int number_close_black_worms[BOARDMAX];
 int close_white_worms[BOARDMAX][MAX_CLOSE_WORMS];
diff -r -u -X .ignore gnugo-copy/engine/liberty.h gnugo/engine/liberty.h
--- gnugo-copy/engine/liberty.h	2006-12-31 16:44:35.687500000 +0100
+++ gnugo/engine/liberty.h	2006-12-31 16:45:19.109375000 +0100
@@ -740,20 +740,16 @@
 extern const int transformation2[8][2][2];
 
 
-/* Arrays pointing out the closest worms from each vertex.  The first
- * one is the closest worms of either color, the last two ones ignore
- * worms of the other color.  Beyond a certain distance from any worm
- * no close worm is listed at all.  Only the closest worm is listed
- * and if more than one are equally close they are all listed. The
- * number of equally close worms is given in the number_*_worms
- * arrays. If more than MAX_CLOSE_WORMS are equally close, none is
- * listed.
+/* Arrays pointing out the closest worms (of given color) from each
+ * vertex.  Beyond a certain distance from any worm no close worm is
+ * listed at all.  Only the closest worm is listed and if more than
+ * one are equally close they are all listed. The number of equally
+ * close worms is given in the number_*_worms arrays. If more than
+ * MAX_CLOSE_WORMS are equally close, none is listed.
  *
  * See compute_effective_worm_sizes() in worm.c for details.
  */
 #define MAX_CLOSE_WORMS 4
-extern int close_worms[BOARDMAX][MAX_CLOSE_WORMS];
-extern int number_close_worms[BOARDMAX];
 extern int close_black_worms[BOARDMAX][MAX_CLOSE_WORMS];
 extern int number_close_black_worms[BOARDMAX];
 extern int close_white_worms[BOARDMAX][MAX_CLOSE_WORMS];
diff -r -u -X .ignore gnugo-copy/engine/worm.c gnugo/engine/worm.c
--- gnugo-copy/engine/worm.c	2006-12-31 13:54:25.093750000 +0100
+++ gnugo/engine/worm.c	2006-12-31 17:20:32.093750000 +0100
@@ -553,18 +553,19 @@
  * territorial value of capturing a worm. Intersections that are
  * shared are counted with equal fractional values for each worm.
  *
- * We never count intersections further away than distance 3.
+ * We never count intersections further away than distance 3 (distance
+ * is number of intersections between a worm and checked intersection -
+ * so when an intersection is adjacent to a worm, it distance is 0).
  *
  * This function is also used to compute arrays with information about
- * the distances to worms of both or either color. In the latter case
- * we count intersections up to a distance of 5.
+ * the distances to worms of either color. In this case we count
+ * intersections up to a distance of 5.
  */
 
 static void
 compute_effective_worm_sizes()
 {
-  do_compute_effective_worm_sizes(BLACK | WHITE, close_worms,
-				  number_close_worms, 3);
+  do_compute_effective_worm_sizes(BLACK | WHITE, NULL, NULL, 3);
   do_compute_effective_worm_sizes(BLACK, close_black_worms,
 				  number_close_black_worms, 5);
   do_compute_effective_worm_sizes(WHITE, close_white_worms,
@@ -611,6 +612,10 @@
   
   dist = 0;
   found_one = 1;
+
+  /* in each iteration dist is increased; found_one
+     means, that at least one unchecked intersection
+     was found in previous iteration */
   while (found_one && dist <= max_distance) {
     found_one = 0;
     dist++;
@@ -618,22 +623,28 @@
       if (distance[pos] != -1 || !ON_BOARD(pos))
 	continue; /* already claimed */
 
+      /* when unchecked intersection is found, all neighboring
+         intersections are checked for equally close worms */
       for (r = 0; r < 4; r++) {
-	int pos2 = pos + delta[r];
+	int neigbor_pos = pos + delta[r];
 	
-	if (ON_BOARD(pos2) && distance[pos2] == dist - 1) {
+	if (ON_BOARD(neigbor_pos) && distance[neigbor_pos] == dist - 1) {
 	  found_one = 1;
 	  distance[pos] = dist;
-	  for (k = 0; k < nworms[pos2]; k++) {
+
+	  /* we check, if a worm is already written into list of equally
+	     close worms for checked position; if not we add new entry
+	     in worms[pos] */
+	  for (k = 0; k < nworms[neigbor_pos]; k++) {
 	    int already_counted = 0;
 	    for (l = 0; l < nworms[pos]; l++)
-	      if (worms[pos][l] == worms[pos2][k]) {
+	      if (worms[pos][l] == worms[neigbor_pos][k]) {
 		already_counted = 1;
 		break;
 	      }
 	    if (!already_counted) {
 	      ASSERT1(nworms[pos] < 2*(board_size-1), pos);
-	      worms[pos][nworms[pos]++] = worms[pos2][k];
+	      worms[pos][nworms[pos]++] = worms[neigbor_pos][k];
 	    }
 	  }
 	}
@@ -641,7 +652,7 @@
     }
   }
 
-  /* Compute the effective sizes but only when all worms are considered. */
+  /* Compute the effective sizes but only when all worms are considered... */
   if (color == (BLACK | WHITE)) {
     /* Distribute (fractional) contributions to the worms. */
     for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
@@ -659,24 +670,30 @@
     
     /* Propagate the effective size values all over the worms. */
     for (pos = BOARDMIN; pos < BOARDMAX; pos++)
-      if (IS_STONE(board[pos]) && is_worm_origin(pos, pos))
-	propagate_worm(pos);
+      if (IS_STONE(board[pos]))
+	worm[pos].effective_size = worm[worm[pos].origin].effective_size;
   }
+  else
+  /* ... or fill in the appropriate close_*_worms (cw) and
+     number_close_*_worms (ncw) arrays. */
+  {
+    int worms_count;
 
-  /* Fill in the appropriate close_*_worms (cw) and
-   * number_close_*_worms (ncw) arrays.
-   */
-  for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
-    if (!ON_BOARD(pos))
-      continue;
+    for (pos = BOARDMIN; pos < BOARDMAX; pos++) {
+      if (!ON_BOARD(pos))
+        continue;
 
-    if (nworms[pos] > MAX_CLOSE_WORMS)
-      ncw[pos] = 0;
-    else
-      ncw[pos] = nworms[pos];
+      worms_count = nworms[pos];
 
-    for (k = 0; k < ncw[pos]; k++)
-      cw[pos][k] = worms[pos][k];
+      if (worms_count > MAX_CLOSE_WORMS) {
+	ncw[pos] = 0;
+	continue;
+      }
+      else
+        ncw[pos] = worms_count;
+
+      memcpy(cw[pos], worms[pos], worms_count * sizeof(int));
+    }
   }
 }
 
