nit: just reuse the variable `i`