method dump (func : int -> int -> 'a -> unit) (func2 : unit -> unit) =
(* go through all lines and call the passed functions *)
for x = 0 to size.x -1 do
for y = 0 to size.y-1 do
func x y nodes.(x).(y).value
done;
func2 ()
done