corrected the mean and median parts