version with single mean and median