summing and counting average