Add index access in map-based for loop