foreach my $ref ( sort { $a cmp $b || substr($a,1) <=> substr($b,1) } keys %{$self->{'residues'}{$i}}){ print "$ref\t"; }