Index: /trunk/Ohana/src/opihi/cmd.basic/list.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 39952)
+++ /trunk/Ohana/src/opihi/cmd.basic/list.c	(revision 39953)
@@ -207,23 +207,27 @@
     char line2[MAX_LINE_LENGTH];
 
-    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
+    snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n
     N = get_int_variable (line, &found);
+
+    // loop over all list elements:
     for (i = 0; i < N; i++) {
       // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);
-      set_list_varname (line, argv[1], i, EXCEL_STYLE);
+      set_list_varname (line, argv[1], i, EXCEL_STYLE); // line = LIST:i
       value = get_variable (line);
       if (value == NULL) continue;
+
+      // if this is the entry we want, delete and shift the rest down
       if (!strcmp (value, argv[3])) {
 	free (value);
 	for (j = i + 1; j < N; j++) {
 	  // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], j);
-	  set_list_varname (line2, argv[1], j, EXCEL_STYLE);
+	  set_list_varname (line2, argv[1], j, EXCEL_STYLE); // line2 = LIST:j
 	  next_value = get_variable (line2);
 	  set_str_variable (line, next_value);
-	  strcpy (line, line2);
+	  strcpy (line, line2); // line = LIST:j (will be j-1 next loop)
 	}
-	DeleteNamedScalar (line);
-	snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);
-	set_int_variable (line2, N - 1);
+	DeleteNamedScalar (line); // line = LIST:(N-1)
+	snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n (new value of n)
+	set_int_variable (line, N - 1);
 	return (TRUE);
       }
