Calculating averages like mean, median and mode