what does this loop do?