Adding code to evaluate aggregate demand based on various z() loss functions