Use for loop counter instead of case id