speed improvement in saving the summary stats