Use block-based enumeration rather than a for loop — we use the index,
so this is cleaner.