added pictures to explain for loop