changed looping