Change to loop

Thought changing to the for-loop would make it run smoother and save trouble in the future if you decide to make strings larger. Also, adding in MAX lets you change a single line instead of a couple (small, but every bit counts I'd say).