Changed List to Queue implementation in Egalitarianism problem