use `i` for index counter