Use C99-style for-loops, much more readable.