I am trying to boost the success propability of standart phase estimation by repeating the procedure enought times and taking a majority vote that will be encoded in a quantum register. My problem is I don't know how to implement a majority vote. How could I implement it?