added a loop