diff --git a/Functions.py b/Functions.py
index eed43ab2d32ce082c06fd6b65fd9e8e30805a611..05fc414e529d72fe7007fc6fd8260a743c42e7e4 100644
--- a/Functions.py
+++ b/Functions.py
@@ -350,15 +350,14 @@ def get_old_new_pos_substitution(feat_start,variation,list_segfeat_azu,feat):
     start_feat=get_feature_start_on_genome(list_segfeat_azu[0][1:],feat)
     start_var=int(segments_on_target_genome[variation.start_on_target][1])
     pos_new=str(start_var-start_feat+1)
-    return [pos_old,pos_new]
+    return [pos_old,pos_new] # pos_old and pos_new are the first base changed
 
 def get_old_new_pos_insertion(variation,feat_start,list_segfeat_azu,feat):
     pos_old=str(int(Segments[variation.start_var].start)-int(feat_start)+1)
-
     start_feat=get_feature_start_on_genome(list_segfeat_azu[0][1:],feat) 
-    start_var=int(segments_on_target_genome[variation.start_var][1])-1
+    start_var=int(segments_on_target_genome[variation.start_var][1])-len(variation.alt)+1
     pos_new=str(start_var-start_feat+1)
-    return [pos_old,pos_new]
+    return [pos_old,pos_new] # pos_old is the base right after the insertion. pos_new SHOULD BE the first inserted base.
 
 def get_old_new_pos_deletion(variation,feat_start,list_segfeat_azu,feat,i):
     if i==0:
@@ -374,8 +373,7 @@ def get_old_new_pos_deletion(variation,feat_start,list_segfeat_azu,feat,i):
         start_feat=get_feature_start_on_genome(list_segfeat_azu[0][1:],feat) 
         start_var=int(segments_on_target_genome[variation.last_seg_in_target][2])+1 
         pos_new=str(start_var-start_feat+1)
-    
-    return [pos_old,pos_new]
+    return [pos_old,pos_new] # pos_old is the first base deleted. pos_new is the base right after the deletion