Add OCaml implementation