adding the loop