Correctness proof for the majority consensus algorithm