diff --git a/cost_function.py b/cost_function.py
index 72d4e6fd03a5e736afb39bcd51155f38cb43c0d9..16391d8c41679726b4c43cfbd3cf595734441061 100755
--- a/cost_function.py
+++ b/cost_function.py
@@ -121,7 +121,7 @@ g.vp['first_av_rad'] = g.new_vp('float')
 g.vp['first_av_ros'] = g.new_vp('float')
 g.vp['last_av_rad'] = g.new_vp('float')
 g.vp['last_av_ros'] = g.new_vp('float')
-g.ep['nl_cost_function'] = g.new_ep('float')
+g.ep['cost_function'] = g.new_ep('float')
 
 # Set up the list of SHPC:
 
@@ -285,8 +285,7 @@ for edge in g.edges():
     cf = math.sqrt(first_term + second_term + third_term)
 
     # assign as weight to the edge
-    g.ep.nl_cost_function[edge] = cf
-
+    g.ep.cost_function[edge] = cf
 
 t1 = time.perf_counter()
 timings.write(f"iterating on edges: {t1 - t0} s\n")