bug fixes (majority element)