add class statisitics in matrix