First ocaml solution