fix median in namespace, fix Q4 bayes functions