diff --git a/dev_tsgcor_GUI.m b/dev_tsgcor_GUI.m
index 5d974ca57237144a35c5e6e0fafa8e3e6997a00c..629458667c1deaa87550b29b4f70f30f0935b3aa 100644
--- a/dev_tsgcor_GUI.m
+++ b/dev_tsgcor_GUI.m
@@ -1,4 +1,4 @@
-function dev_tsgcor_GUI
+function dev_tsgcor_GUI( hMainFig )
 % dev_tsgcor_GUI 
 %
 % GUI for correction of TSG data by comparison to samples
@@ -265,13 +265,16 @@ function dev_tsgcor_GUI
 
 % Lecture fichier TSG
 % -------------------
-filename = 'F:\work\M_TsgQc\tsg_data\past0601.txt';
-[tsg, error] = dev_readTsg( filename);
+% filename = 'F:\work\M_TsgQc\tsg_data\past0601.txt';
+% [tsg, error] = dev_readTsg( filename);
 
 % Lecture fichier bucket
 % -----------------------
-filename = 'F:\work\M_TsgQc\tsg_data\past0601.btl';
-[bucketASCII, error] = dev_readBucket( filename);
+% filename = 'F:\work\M_TsgQc\tsg_data\past0601.btl';
+% [bucketASCII, error] = dev_readBucket( filename);
+
+tsg    = getappdata( hMainFig, 'tsg_data' );
+sample = getappdata( hMainFig, 'sample' );
 
 % Salinity, in one 1 hour interval, should not depart the average for more
 % than SAL_STD_MAX standard deviation
@@ -291,12 +294,12 @@ COR_TIME_WINDOWS = 10;
       dev_moveaverage(tsg.TIME, tsg.PSAL, TSG_DT_SMOOTH, TSG_STDMAX);
 
 % Merge the 2 types of 'bucket' records, if they exists
-bucketNETCDF      = bucketASCII;
-bucketNETCDF.TIME = bucketNETCDF.TIME + 1;
-bucketNETCDF.PSAL = bucketNETCDF.PSAL + 1;
-bucketNETCDF = struct([]);
-sample = dev_mergesample( bucketNETCDF, bucketASCII);
-  
+%bucketNETCDF      = bucketASCII;
+%bucketNETCDF.TIME = bucketNETCDF.TIME + 1;
+%bucketNETCDF.PSAL = bucketNETCDF.PSAL + 1;
+%bucketNETCDF = struct([]);
+%sample = dev_mergesample( bucketNETCDF, bucketASCII);
+
 % Compute the sample-TSG differences
 sample = dev_diffTsgSample(tsg, psal_smooth, sample, TSG_SAMPLING_TIME);
 
@@ -645,11 +648,7 @@ axes(hPlotAxes(1));
   function QuitProgram(hObject, eventdata)
 
     delete(hChild1Fig);
-    % reset Matlab search path to default
-    rmpath( [DEFAULT_PATH_FILE filesep 'tsg_util'] );
-    rmpath( [DEFAULT_PATH_FILE filesep 'tsg_data'] );
-    rehash;
+
   end
       
-
 end
diff --git a/tsg_util/tsg_initialisation.m b/tsg_util/tsg_initialisation.m
index c0e1ec9e7d9914a89304a905b3ce442968820fef..6d3019f0a31294c804532cc236b9e2a5fc3f87c0 100644
--- a/tsg_util/tsg_initialisation.m
+++ b/tsg_util/tsg_initialisation.m
@@ -8,6 +8,10 @@ function tsg_initialisation(hTsgGUI, hQcCmenu)
 % ------
 % $Id$
 
+
+% *************************************************************************
+%              Constants for the quality control procedure
+
 % Quality Code and color
 
 qc.Color.NO_CONTROL    = 'k';
@@ -22,12 +26,39 @@ qc.Code.PROBABLY_GOOD  = 3;
 qc.Code.PROBABLY_BAD   = 4;
 qc.Code.BAD            = 5;
 
+% Store default value 'quality' a application data
+% ------------------------------------------------
 quality.Code  = qc.Code.GOOD;
 quality.Color = qc.Color.GOOD;
 set( hQcCmenu, 'UserData', quality );
 
-% Set named application data
-% -------------------------------
+% Store the 'qc' structure as application data
+% --------------------------------------------
 setappdata( hTsgGUI, 'qcColor', qc);
 
+
+% *************************************************************************
+%              Constants for the Correction procedure
+
+% Smoothing of tsg time series over 1 hour interval
+% 1 hour interval expressed in MATLAB serial Number
+% -------------------------------------------------
+const.TSG_DT_SMOOTH = datenum(0, 0, 0, 1, 0 , 0);
+
+% Smoothing of tsg time series :
+% Salinity, in one 1 hour interval, should not depart the average for more
+% than SAL_STD_MAX standard deviation
+% -----------------------------------------------------------------------
+const.TSG_STDMAX = 0.1;
+
+% Correction is estimated by computing the median value of X tsg-sample
+% differences
+% Amount of days used to compute the correction
+% ---------------------------------------------------------------------
+const.COR_TIME_WINDOWS = 10;
+
+% store the 'const' structure as an application data
+% --------------------------------------------------
+setappdata( hTsgGUI, 'constante', const);
+
 end
diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m
index 43953d400d6a723bb0d11bac29156c451ceb6fe7..8fa9b232f3854b86376c22bba29ccaa86206a622 100644
--- a/tsgqc_GUI.m
+++ b/tsgqc_GUI.m
@@ -669,12 +669,13 @@ function tsgqc_GUI
 
             % Test if tsg and sample data have been loaded
             % --------------------------------------------
-            if ~isempty( getappdata( hMainFig, 'sample') ) && ...
+            if ~isempty( getappdata( hMainFig, 'tsg_data') ) && ...
                ~isempty( getappdata( hMainFig, 'sample') )
            
                 % Call the GUI for tsg correction
                 % -------------------------------
                 msgbox('The correction module has not been implemented');
+                %dev_tsgcor_GUI( hMainFig );
                 
             else