Make "mode" a local variable to the for loop, now that we don't need it anymore.