added a for loop to the sample