Creating the recursive create_convex function