Updated code for looping