Finished changes for looping'