The code would be more elegant as a for-loop. The initialization of the variable <code>i</code> above can also be removed.