got the looping to work