saved you some bytes
Merge pull request #1 from aynik/master

Use for instead of while