let pred = function
| None -> None
- | Some i when i > 0 -> Some (pred i)
+ | Some i when i > 1 -> Some (pred i)
+ | _ -> Some 0
+
+let minus n j = match n with
+ | None -> None
+ | Some i when i > j -> Some (i - j)
| _ -> Some 0
let to_string = function