add codes from unix ocaml programming