my $last_idx = scalar @{$self->{tokens}->{$tag}}-1;