don't use List.iteri (requires Ocaml 4.0+)