diff -N -r -u -X .ignore gnugo-copy/config.vcin gnugo/config.vcin
--- gnugo-copy/config.vcin	2005-09-29 01:53:46.000000000 +0200
+++ gnugo/config.vcin	2007-01-22 14:41:38.781250000 +0100
@@ -19,7 +19,7 @@
 #define DEFAULT_LEVEL 10
 
 /* Default hash table size in megabytes */
-#define DEFAULT_MEMORY 8
+#define DEFAULT_MEMORY -1
 
 /* Compile support for GTP communication over TCP/IP channel. */
 #define ENABLE_SOCKET_SUPPORT 1
diff -N -r -u -X .ignore gnugo-copy/engine/board.c gnugo/engine/board.c
--- gnugo-copy/engine/board.c	2007-01-02 19:48:48.906250000 +0100
+++ gnugo/engine/board.c	2007-01-22 16:42:45.093750000 +0100
@@ -693,20 +693,20 @@
       return 0;
     
     /* 4. Test if the location is the ko point. */
-	if (pos == board_ko_pos) {
+    if (pos == board_ko_pos) {
       /*    The ko position is guaranteed to have all neighbors of the
        *    same color, or off board. If that color is the same as the
        *    move the ko is being filled, it is always allowed. This
        *    could be tested with has_neighbor() but here a faster test
        *    suffices.
        */
-	  if (board[WEST(pos)] == OTHER_COLOR(color)
-	      || board[EAST(pos)] == OTHER_COLOR(color))
-        *ko_move_allowed = 1;
-	}
+      if (board[WEST(pos)] == OTHER_COLOR(color)
+	  || board[EAST(pos)] == OTHER_COLOR(color))
+	*ko_move_allowed = 1;
+    }
 
     /* 5. Test for suicide. */
-	if (is_suicide(pos, color)) {
+    if (is_suicide(pos, color)) {
       *ko_move_allowed = 0;
       return 0;
     }
@@ -1758,7 +1758,6 @@
 int
 findlib(int str_pos, int maxlib, int *libs)
 {
-  int k;
   int liberties;
   int to_copy;
   int str_nr;
@@ -1778,20 +1777,21 @@
   liberties = string[str_nr].liberties;
   to_copy = maxlib > liberties ? liberties : maxlib;
 
-  if (to_copy <= MAX_LIBERTIES) {
+  if (to_copy <= MAX_LIBERTIES)
     /* The easy case, it suffices to copy liberty locations from the
      * incrementally updated list.
      */
-    for (k = 0; k < to_copy; k++)
-      libs[k] = string_libs[str_nr].list[k];
-  }
+    memcpy(libs, string_libs[str_nr].list, to_copy * sizeof(libs[0]));
   else {
     /* The harder case, where we have to traverse the stones in the
      * string. We don't have to check explicitly if we are back to
      * the start of the chain since we will run out of liberties
      * before that happens.
      */
-    int pos, checked_pos;
+    int pos;
+    int checked_pos;
+    int k;
+
     liberty_mark++;
     for (k = 0, pos = FIRST_STONE(str_nr);
 	 k < to_copy;
diff -N -r -u -X .ignore gnugo-copy/engine/liberty.h gnugo/engine/liberty.h
--- gnugo-copy/engine/liberty.h	2006-12-31 16:45:19.109375000 +0100
+++ gnugo/engine/liberty.h	2007-01-22 16:58:48.687500000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -337,6 +337,10 @@
 void movelist_change_point(int move, int code, int max_points, 
 			   int points[], int codes[]);
 
+/* worm.c */
+void change_tactical_point(int str, int move, int code,
+			   int points[], int codes[]);
+
 /* surround.c */
 int compute_surroundings(int pos, int apos, int showboard,
 			 int *surround_size);
diff -N -r -u -X .ignore gnugo-copy/engine/movelist.c gnugo/engine/movelist.c
--- gnugo-copy/engine/movelist.c	2006-01-23 19:15:50.000000000 +0100
+++ gnugo/engine/movelist.c	2007-01-07 22:54:09.957875000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -29,8 +29,8 @@
 #include "liberty.h"
 
 
-static void movelist_sort_points(int max_points, int points[], int codes[]);
-static void swap_points_and_codes(int points[], int codes[], int m, int n);
+static void move_up_list(int points[], int codes[], int inserted_index);
+static void move_down_list(int last_index, int points[], int codes[], int changed_index);
 
 
 /* Return the code for the move if it is known.
@@ -69,67 +69,78 @@
 
   /* Yes, we do. */
   if (k < max_points) {
-    if (codes[k] <= code)
+    if (code >= codes[k])
       return; /* Old news. */
 
     codes[k] = code;
-    movelist_sort_points(max_points, points, codes);
-    return;
+    move_down_list(k, points, codes, k);
   }
-
   /* This tactical point is new to us. */
-  if (code > codes[max_points - 1]) {
-    points[max_points - 1] = move;
-    codes[max_points - 1] = code;
-    movelist_sort_points(max_points, points, codes);
+  else {
+    k--; /* last index */
+    if (code <= codes[k])
+      return; /* Too bad move to store. */
+
+    points[k] = move;
+    codes[k] = code;
+    move_up_list(points, codes, k);
   }
 }
 
 
-/* Sort the tactical points so we have it sorted in falling order on
- * the code values.
- *
- * We use shaker sort because we prefer a stable sort and in all use
- * cases we can expect it to suffice with one turn through the outer
- * loop.
+/* Sort the changed tactical point. We set it to the higher value, so
+ * we just have to move it up the table.
  */
 
 static void
-movelist_sort_points(int max_points, int points[], int codes[])
+move_up_list(int points[], int codes[], int inserted_index)
 {
-  int start = 0;
-  int end = max_points - 1;
-  int new_start;
-  int new_end;
-  int k;
-  
-  while (start < end) {
-    new_start = end;
-    for (k = end; k > start; k--)
-      if (codes[k] > codes[k-1]) {
-	swap_points_and_codes(points, codes, k, k-1);
-	new_start = k;
-      }
-    start = new_start;
-    new_end = start;
-    for (k = start; k < end - 1; k++)
-      if (codes[k] < codes[k+1]) {
-	swap_points_and_codes(points, codes, k, k+1);
-	new_end = k;
-      }
-    end = new_end;
+  int new_index;
+  int inserted_code = codes[inserted_index];
+
+  for (new_index = inserted_index; new_index > 0; new_index--) {
+    if (inserted_code <= codes[new_index - 1])
+      break;
+  }
+
+  if (new_index != inserted_index) {
+    int tmp = points[inserted_index];
+    memmove(points + new_index + 1, points + new_index,
+	    (inserted_index - new_index) * sizeof(int));
+    points[new_index] = tmp;
+
+    memmove(codes + new_index + 1, codes + new_index,
+	    (inserted_index - new_index) * sizeof(int));
+    codes[new_index] = inserted_code;
   }
 }
 
+
+/* Sort the changed tactical point. We set it to the lower value, so
+ * we just have to move it down the table.
+ */
+
 static void
-swap_points_and_codes(int points[], int codes[], int m, int n)
+move_down_list(int last_index, int points[], int codes[], int changed_index)
 {
-  int tmp = points[m];
-  points[m] = points[n];
-  points[n] = tmp;
-  tmp = codes[m];
-  codes[m] = codes[n];
-  codes[n] = tmp;
+  int new_index;
+  int inserted_code = codes[changed_index];
+
+  for (new_index = changed_index; new_index < last_index; new_index++) {
+    if (inserted_code >= codes[new_index + 1])
+      break;
+  }
+
+  if (new_index != changed_index) {
+    int tmp = points[changed_index];
+    memmove(points + changed_index, points + changed_index + 1,
+	    (new_index - changed_index) * sizeof(int));
+    points[new_index] = tmp;
+
+    memmove(codes + changed_index, codes + changed_index + 1,
+	    (new_index - changed_index) * sizeof(int));
+    codes[new_index] = inserted_code;
+  }
 }
 
 
diff -N -r -u -X .ignore gnugo-copy/engine/persistent.c gnugo/engine/persistent.c
--- gnugo-copy/engine/persistent.c	2006-11-12 15:30:26.000000000 +0100
+++ gnugo/engine/persistent.c	2007-01-22 17:10:22.453125000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -445,7 +445,7 @@
     print_persistent_cache_entry(entry);
   }
   /* FIXME: This is an ugly hack. */
-  if (cache->name == "reading cache"
+  if (strcmp(cache->name, "reading cache") == 0
       && (debug & DEBUG_READING_PERFORMANCE)
       && entry->cost >= MIN_READING_NODES_TO_REPORT) {
     if (entry->result != 0)
diff -N -r -u -X .ignore gnugo-copy/engine/reading.c gnugo/engine/reading.c
--- gnugo-copy/engine/reading.c	2007-01-09 16:47:07.765625000 +0100
+++ gnugo/engine/reading.c	2007-01-22 17:14:36.234375000 +0100
@@ -2,7 +2,7 @@
  * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
  * http://www.gnu.org/software/gnugo/ for more information.          *
  *                                                                   *
- * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005 and 2006       *
+ * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 and 2007 *
  * by the Free Software Foundation.                                  *
  *                                                                   *
  * This program is free software; you can redistribute it and/or     *
@@ -1055,7 +1055,7 @@
       if (trymove(aa, other, "attack_threats-A", str)) {
        int acode = attack(str, NULL);
        if (acode != 0)
-	 movelist_change_point(aa, acode, max_points, moves, codes);
+	 change_tactical_point(str, aa, acode, moves, codes);
        popgo();
       }
 
@@ -1071,7 +1071,7 @@
        if (trymove(bb, other, "attack_threats-B", str)) {
          int acode = attack(str, NULL);
          if (acode != 0)
-	   movelist_change_point(bb, acode, max_points, moves, codes);
+	   change_tactical_point(str, bb, acode, moves, codes);
          popgo();
        }
       }
@@ -1117,7 +1117,7 @@
 	else
 	  acode = attack(str, NULL);
 	if (acode != 0)
-	  movelist_change_point(bb, acode, max_points, moves, codes);
+	  change_tactical_point(str, bb, acode, moves, codes);
 	popgo();
       }
     }
diff -N -r -u -X .ignore gnugo-copy/engine/worm.c gnugo/engine/worm.c
--- gnugo-copy/engine/worm.c	2007-01-02 20:02:58.859375000 +0100
+++ gnugo/engine/worm.c	2007-01-22 17:19:37.531250000 +0100
@@ -37,9 +37,6 @@
 static void find_worm_attacks_and_defenses(void);
 static void find_worm_threats(void);
 static int find_lunch(int str, int *lunch);
-static void change_tactical_point(int str, int move, int code,
-				  int points[MAX_TACTICAL_POINTS],
-				  int codes[MAX_TACTICAL_POINTS]);
 static void propagate_worm2(int str);
 static int genus(int str);
 static void markcomponent(int str, int pos, int mg[BOARDMAX]);
@@ -758,14 +755,6 @@
       continue;
 
     TRACE("considering attack of %1m\n", str);
-    /* Initialize all relevant fields at once. */
-    for (k = 0; k < MAX_TACTICAL_POINTS; k++) {
-      worm[str].attack_codes[k]   = 0;
-      worm[str].attack_points[k]  = 0;
-      worm[str].defense_codes[k]  = 0;
-      worm[str].defense_points[k] = 0;
-    }
-    propagate_worm(str);
     
     acode = attack(str, &attack_point);
     if (acode != 0) {
@@ -1182,7 +1171,7 @@
  * change_defense_threat().
  */
 
-static void
+void
 change_tactical_point(int str, int move, int code,
 		      int points[MAX_TACTICAL_POINTS],
 		      int codes[MAX_TACTICAL_POINTS])
diff -N -r -u -X .ignore gnugo-copy/makevcdist.pl gnugo/makevcdist.pl
--- gnugo-copy/makevcdist.pl	2005-10-21 13:01:16.000000000 +0200
+++ gnugo/makevcdist.pl	2007-01-22 14:36:53.171875000 +0100
@@ -9,7 +9,7 @@
    RESIGNATION_ALLOWED => 1,
    HASHING_SCHEME => 2,
    DEFAULT_LEVEL => 10,
-   DEFAULT_MEMORY => 8,
+   DEFAULT_MEMORY => -1,
    ENABLE_SOCKET_SUPPORT => 1,
    ALTERNATE_CONNECTIONS => 1,
    SEMEAI_NODE_LIMIT => 500,
