rename loop attribute `i` to `index`