update algorithm to fit original 2-phase Moore’s voting algorithm