use median instead of mean