Converted loop to for_each.