for my $i (0..$#sortedNames) {