Updated for loop with closure