added a placeholder median function, needs to be replaced
merged with upstream