Maximizing Profit and the Average Cost Curve