foreach my $iid ( sort { $hash{$name}{$b} <=> $hash{$name}{$a} } keys %{$hash{$name}}) {