add average caculation