Attempted to fix the optimization to give more weight to fairness.