events for loop part 1