Replace while-loop by for-loop
Merge pull request #22 from jeroenk/while-for

Replace while-loop by for-loop