how to find the median from a frequency table