Minor nitpick, but `last` can be declared here to use all the expressions of the `for` loop.