working on the loop