Changed code to perform more efficient mass summarization without
running out of memory