changing convex function almost done