diff --git a/src/@deproj/deproj.m b/src/@deproj/deproj.m
index 13c595f6d20e47be61b9fafc14ab6c99ef493cfe..36c371c109becae7fc765aa673f74359ca857f0e 100644
--- a/src/@deproj/deproj.m
+++ b/src/@deproj/deproj.m
@@ -90,6 +90,7 @@ classdef deproj
         
         % Add the tissue plot colored with the error on cell perimeter caused by the projection.
         hts = add_plot_distorsion_perimeter( obj, ax )
+
                 
     end
     
@@ -123,7 +124,7 @@ classdef deproj
         [ curvMean, curvGauss, curvK1, curvK2 ] = compute_curvatures( H, object_scale, pixel_size, voxel_depth, invert_z )
         
         % Sort the points of a polygon in clockwise manner.
-        P2 = sort_polygon( P )
+        [ P2, I ] = sort_polygon( P )
         
         % Sort x,y coordinates along a continuous contour.
         P2 = find_countour( P )
diff --git a/src/@deproj/sort_polygon.m b/src/@deproj/sort_polygon.m
index 58c5ef5226c9e9e00f8847bb10bd9ca2680fbefc..d8979b229165e37e43dd3f6bf6dc7d8b6539fe06 100644
--- a/src/@deproj/sort_polygon.m
+++ b/src/@deproj/sort_polygon.m
@@ -1,4 +1,4 @@
-function P2 = sort_polygon( P )
+function [ P2, sort_indexes ] = sort_polygon( P )
 %SORT_POLYGON Sort the points of a polygon in clockwise manner.
     
     center = mean( P );