diff -Naur _ngi-3a/Makefile _ngi-3b/Makefile
--- _ngi-3a/Makefile	2026-02-22 15:54:31.607710681 +0100
+++ _ngi-3b/Makefile	2026-02-22 15:54:32.163710664 +0100
@@ -1,3 +1,4 @@
 clean:
 	$(MAKE) -C _ngi/ clean
 	$(MAKE) -C _ntrf/ clean
+	$(MAKE) -C _test/ clean
diff -Naur _ngi-3a/_ngi/pool.c _ngi-3b/_ngi/pool.c
--- _ngi-3a/_ngi/pool.c	2026-02-22 15:54:31.771710676 +0100
+++ _ngi-3b/_ngi/pool.c	2026-02-22 15:54:32.302710659 +0100
@@ -66,6 +66,18 @@
   printf("\n");
 }
 void
+fill_pool_n(int *p, int n, int c)
+{ int d;
+  for (d=0;d<n;d++)
+  { int a, b;
+    int n0;
+    a = p[(d*2)];
+    b = p[(d*2)+1];
+    int d = _ab(a, b);
+    fill_pool_d(c, d);
+  }
+}
+void
 dump_pool()
 { int d;
   printf("P3\n");
diff -Naur _ngi-3a/_ngi/pool.h _ngi-3b/_ngi/pool.h
--- _ngi-3a/_ngi/pool.h	2026-02-22 15:54:31.748710677 +0100
+++ _ngi-3b/_ngi/pool.h	2026-02-22 15:54:32.291710660 +0100
@@ -6,6 +6,9 @@
 #define _POOL_LIB_H_
 
 void
+fill_pool_n(int *p, int n, int c);
+
+void
 fill_pool_0();
 
 void
diff -Naur _ngi-3a/_ntrf/ngi2.ml _ngi-3b/_ntrf/ngi2.ml
--- _ngi-3a/_ntrf/ngi2.ml	2026-02-22 15:54:32.039710668 +0100
+++ _ngi-3b/_ntrf/ngi2.ml	2026-02-22 15:54:32.812710643 +0100
@@ -1,4 +1,7 @@
 
+external fill_pool_n : (int * int) array -> int -> unit
+  = "caml_fill_pool_n"
+
 external fill_pool_0 : unit -> unit
   = "caml_fill_pool_0"
 
diff -Naur _ngi-3a/_ntrf/ngi2.mli _ngi-3b/_ntrf/ngi2.mli
--- _ngi-3a/_ntrf/ngi2.mli	2026-02-22 15:54:32.048710667 +0100
+++ _ngi-3b/_ntrf/ngi2.mli	2026-02-22 15:54:32.698710647 +0100
@@ -1,4 +1,6 @@
 
+val fill_pool_n : (int * int) array -> int -> unit
+
 val fill_pool_0 : unit -> unit
 val fill_pool_a : unit -> unit
 val fill_stride : unit -> unit
diff -Naur _ngi-3a/_ntrf/ngi2_stub.c _ngi-3b/_ntrf/ngi2_stub.c
--- _ngi-3a/_ntrf/ngi2_stub.c	2026-02-22 15:54:32.058710667 +0100
+++ _ngi-3b/_ntrf/ngi2_stub.c	2026-02-22 15:54:32.586710650 +0100
@@ -44,6 +44,23 @@
   return Val_unit;
 }
 
+#define PS_NUM 20000
+CAMLprim value
+caml_fill_pool_n(value caml_ps, value caml_c)
+{
+  int p[20000*2];
+  int d, n;
+  n = Wosize_val(caml_ps);
+  if (n>20000) caml_failwith("fill_pool_n");
+  for (d=0;d<n;d++) {
+    value caml_p=Field(caml_ps,d);
+    p[(d*2)]=  Long_val(Field(caml_p,0));
+    p[(d*2)+1]=Long_val(Field(caml_p,1));
+  }
+  fill_pool_n(p,n,Long_val(caml_c));
+  return Val_unit;
+}
+
 CAMLprim value
 caml_add_c3(value caml_c)
 {
diff -Naur _ngi-3a/_test/Makefile _ngi-3b/_test/Makefile
--- _ngi-3a/_test/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3b/_test/Makefile	2026-02-22 15:54:32.218710662 +0100
@@ -0,0 +1,14 @@
+all: test1.pbm test2.pbm test3.pbm test4.pbm
+test1.pbm: test1.ml
+	\ocaml -I ../_ntrf/ ngi2.cma $< > $@
+test2.pbm: test2.ml
+	\ocaml -I ../_ntrf/ ngi2.cma $< > $@
+test3.pbm: test3.ml
+	\ocaml -I ../_ntrf/ ngi2.cma $< > $@
+test4.pbm: test4.ml
+	\ocaml -I ../_ntrf/ ngi2.cma $< > $@
+clean:
+	$(RM) test1.pbm
+	$(RM) test2.pbm
+	$(RM) test3.pbm
+	$(RM) test4.pbm
diff -Naur _ngi-3a/_test/test2.ml _ngi-3b/_test/test2.ml
--- _ngi-3a/_test/test2.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3b/_test/test2.ml	2026-02-22 15:54:32.231710662 +0100
@@ -0,0 +1,25 @@
+open Ngi2
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (255, 255, 255) in
+  default_c3 (c);
+  let c0 = (0, 0, 0) in
+  add_c3 (c0);
+  let b = 19 in
+  let l = max_num () in
+  for a = 20 to pred 79 do
+    let d = _ab (a) (b) in
+    fill_pool_d (l-1) (d);
+  done;
+  let ps =
+    Array.init 10 (fun _ ->
+      (Random.int 120,
+       Random.int 80)
+    )
+  in
+  fill_pool_n ps (l-1);
+  dump_pool ();
+;;
diff -Naur _ngi-3a/_test/test3.ml _ngi-3b/_test/test3.ml
--- _ngi-3a/_test/test3.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3b/_test/test3.ml	2026-02-22 15:54:32.186710663 +0100
@@ -0,0 +1,42 @@
+open Ngi2
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  !l
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (255, 255, 255) in
+  default_c3 (c);
+  let c0 = (0, 0, 0) in
+  add_c3 (c0);
+  let b = 19 in
+  let l = max_num () in
+  for a = 20 to pred 79 do
+    let d = _ab (a) (b) in
+    fill_pool_d (l-1) (d);
+  done;
+  let ps =
+    Array.init 10 (fun _ ->
+      (Random.int 120,
+       Random.int 80)
+    )
+  in
+  fill_pool_n ps (l-1);
+  let ps = circ (20, 20) 20 in
+  let ps = Array.of_list ps in
+  fill_pool_n ps (l-1);
+  dump_pool ();
+;;
diff -Naur _ngi-3a/_test/test4.ml _ngi-3b/_test/test4.ml
--- _ngi-3a/_test/test4.ml	1970-01-01 01:00:00.000000000 +0100
+++ _ngi-3b/_test/test4.ml	2026-02-22 15:54:32.197710663 +0100
@@ -0,0 +1,68 @@
+open Ngi2
+let f ps = ps |> Array.to_list |>
+  List.filter (fun (a,b) -> a>=0 && b>=0 && a<120 && b<80) |> Array.of_list
+let sq_sqrt (da, db) (pa, pb) =
+  let a = (da - pa) in
+  let b = (db - pb) in
+  (a * a + b * b)
+let circ (a, b) r =
+  let l = ref [] in
+  let r2 = (r * r) in
+  for _a = a - r to a + r do
+    for _b = b - r to b + r do
+      if sq_sqrt (_a, _b) (a, b) < r2 then
+        l := (_a, _b) :: !l
+    done;
+  done;
+  f (Array.of_list !l)
+let () =
+  Random.self_init ();
+  fill_pool_0 ();
+  fill_pool_a ();
+  fill_stride ();
+  let c = (255, 255, 255) in
+  default_c3 (c);
+  let c0 = (0, 0, 0) in
+  add_c3 (c0);
+  let b = 19 in
+  let l0 = max_num () in
+  for a = 20 to pred 79 do
+    let d = _ab (a) (b) in
+    fill_pool_d (l0-1) (d);
+  done;
+  let ps =
+    Array.init (24*2*3*5*2) (fun _ ->
+      (Random.int 120,
+       Random.int (72 -10))
+    )
+  in
+  fill_pool_n ps (l0-1);
+  begin
+    let ps = circ (20, 20) (20-4) in
+    let c1 = (255, 0, 0) in
+    add_c3 (c1);
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let c2 = (10, 11, 255) in
+    add_c3 (c2);
+    let ps =
+      Array.init (36*(2+1)) (fun _ ->
+        let b = Random.int 2 in
+        (Random.int 120, (79-6+b)))
+    in
+    let l = max_num () in
+    fill_pool_n ps (l-1);
+    let ps = circ (110, 60) (20-4-4-2-2) in
+    (*
+    let ps = circ (110, 60) (20+4) in
+    *)
+    fill_pool_n ps (l-1);
+  end;
+  begin
+    let ps = circ (20, 20) (20-6) in
+    fill_pool_n ps (l0-1);
+  end;
+  dump_pool ();
+;;
