Unrelated to the PR, but is there a reason we are using `var` in the loop instead of at the top of the method?