implementing majorityVoting