diff --git a/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/Surface.java b/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/Surface.java
index 2d10930542fc34b74ab16339f7f6d3b604a364e4..ec5214dcde63236e53432f61ec078858fc8e3f5f 100644
--- a/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/Surface.java
+++ b/src/main/java/fr/pasteur/ida/zellige/surfaceConstruction/element/Surface.java
@@ -163,13 +163,16 @@ public class Surface
     {
         Surface surface = new Surface( Math.abs( this.dimension - 1 ), width, height );
         Class< ? > theClass;
+        int length;
         if ( this.dimension == 0 )
         {
             theClass = SurfaceLineY.class;
+            length = height;
         }
         else
         {
             theClass = SurfaceLineX.class;
+            length = width;
         }
 
         for ( int i = 0; i <= this.getLength() - 1; i++ )
@@ -187,7 +190,7 @@ public class Surface
                         {
                             try
                             {
-                                newSurfaceLine = ( SurfaceLine ) theClass.getDeclaredConstructors()[ 1 ].newInstance( j );
+                                newSurfaceLine = ( SurfaceLine ) theClass.getDeclaredConstructors()[ 1 ].newInstance( length, j );
                             }
                             catch ( InstantiationException | IllegalAccessException | InvocationTargetException e )
                             {
@@ -240,6 +243,7 @@ public class Surface
 
     public Img< UnsignedShortType > getZMap()
     {
+        int count = 0;
         Dimensions dim = FinalDimensions.wrap( new long[]{width,height });
         ImgFactory< UnsignedShortType > factory = Util.getArrayOrCellImgFactory(dim, new UnsignedShortType());
         Img< UnsignedShortType > zMap = factory.create(dim);
@@ -256,6 +260,7 @@ public class Surface
                     {
                         if ( pixel.size() > 1 )
                         {
+                            count++;
                             int z = averageIntZ( pixel ) ;
                             if ( z != -1 )
                             {
@@ -273,6 +278,7 @@ public class Surface
                 }
             }
         }
+        System.out.println(" Thre count =  " + count);
         return zMap;
     }