Making J and K values not depend only on max(D+E)