added function to compute summary stats of final matrix