Updated profit function.