my @sorted_keys = sort { $hash{$a}{current}[0] <=> $hash{$b}{current}[0] } keys %hash;