Moore's voting algorithm