Signed/unsigned comparisons: this code will not compile on Windows. Use `size_t` for `i`.