finding the mean from a frequency table