a small optimization in the summing of character counts: now we skip indices that are always 0