Update majority function