`i` is a global variable here.