tried mode algorithm for consensus