added check for majority voting