diff --git a/artoa.ini b/artoa.ini
index 59a7bfb2e9d6dffc326ad10937de9fd52d27828c..acb0d3efda88619e780516648ae4efd3641c18cd 100644
--- a/artoa.ini
+++ b/artoa.ini
@@ -1,7 +1,8 @@
 % ARTOA ini file for dimes first three floats
 
 [files]
--soundsourcefile    C:\MyData\RAFOS\HAFOS.soso
+%-soundsourcefile    C:\MyData\RAFOS\HAFOS.soso
+-soundsourcefile    C:\MyData\RAFOS\TESTwithOFFSETS.soso
 -floatfile          ..\HAFOS.flo  % not used in artoa4 yet
 -bathyfile          ..\HAFOS.prj  % not used in artoa4 yet
 -etopo              C:\MyData\TOPO\etopo1_ice_c.flt
diff --git a/lib/+artoa/+controller/+edit/+offsets/buttonCalculateOffsets.m b/lib/+artoa/+controller/+edit/+offsets/buttonCalculateOffsets.m
index 0bfea9afae00ce84bafd9db9204f47cb32377b28..a018852d2e8fd69f8f17772a41a89697eed05eee 100644
--- a/lib/+artoa/+controller/+edit/+offsets/buttonCalculateOffsets.m
+++ b/lib/+artoa/+controller/+edit/+offsets/buttonCalculateOffsets.m
@@ -22,6 +22,7 @@ toaData.toa = artoaDataInput.toaData.toa;
     artoaWorkspace.editOffsets.unfilteredA, ...
     artoaWorkspace.editOffsets.unfilteredB, ...
     artoaWorkspace.editOffsets.D, ...
+    artoaWorkspace.editOffsets.soundspeed,...      % Olaf Boebel 2022-10-07
 ] = artoa.offsets.solve( ...
     artoaDataInput.rfb, ...
     soundsources, ...
diff --git a/lib/+artoa/+controller/+file/saveOptimumTables.m b/lib/+artoa/+controller/+file/saveOptimumTables.m
index d0fb2f1afb7e35520f581d5087f69b5883e45391..9e14a871836efb172a3f09dc1a92572fc06b4290 100644
--- a/lib/+artoa/+controller/+file/saveOptimumTables.m
+++ b/lib/+artoa/+controller/+file/saveOptimumTables.m
@@ -8,10 +8,10 @@ global artoaWorkspace artoaConfig;
 unfilteredA = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredA'}, false);
 unfilteredB = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredB'}, false);
 A = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'A'}, false);
-B = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'B'}, false);
-X = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'X'}, false);
+B = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'B'}, false);  % retains columns corresponding to fitted values
+X = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'X'}, false);  % fitted values
 D = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'D'}, false);
-offsets = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'offsets'}, false);
+offsets = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'offsets'}, false);  % the current offset table
 soundspeed = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'soundspeed'}, false);
 
 if islogical(unfilteredA) || islogical(unfilteredB) ...
diff --git a/lib/+artoa/+load/rfb.m b/lib/+artoa/+load/rfb.m
index f06b87fdba021870b30d1678fbdc0f65849d7da8..e58bd552b65dce068e3b7b8f5493c3b4eec69a58 100644
--- a/lib/+artoa/+load/rfb.m
+++ b/lib/+artoa/+load/rfb.m
@@ -33,4 +33,4 @@ end
 
 rfbfile = artoa.load.tomlini(pFilename);
 
-end
+cdend
diff --git a/lib/+artoa/+offsets/createCalculationTables.m b/lib/+artoa/+offsets/createCalculationTables.m
index 6e765642af780a4f0ab2b42c4e3b62198200d4e2..6e08fce1c21e3c382716c91b1a12ff9acfe679b1 100644
--- a/lib/+artoa/+offsets/createCalculationTables.m
+++ b/lib/+artoa/+offsets/createCalculationTables.m
@@ -2,6 +2,9 @@ function [a, b, c, d] = createCalculationTables(pRfb, pSoundsources, pTrackingPa
 %CREATECALCULATIONMATRICES Summary of this function goes here
 %   Detailed explanation goes here
 
+% Olaf Boebel 2022-10-18: the calling function passes pSoundvelocity to his function.
+%             pSoundvelocity semms to host the "Applied to" sound source velocities
+
 %% Initialize required variables
 %pSoundsources = artoa.controller.getSoundsourcesWithAppliedToa();
 satPositions = [pSatData.lat_sat, pSatData.lon_sat];
diff --git a/lib/+artoa/+offsets/solve.m b/lib/+artoa/+offsets/solve.m
index d2bbc268abfaa7855e1980b4d96f6c8576d1d927..5edf4edc4dd5135932e08b18c9ab9ac4e0b50b4e 100644
--- a/lib/+artoa/+offsets/solve.m
+++ b/lib/+artoa/+offsets/solve.m
@@ -1,4 +1,8 @@
-function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
+%function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
+% Olaf Boebel 2022-11-03   added 'soundspeed' to output arguments
+function [A, B, X, unfilteredA, unfilteredB, D, soundspeed] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
+
+
 %UNTITLED Summary of this function goes here
 %   Detailed explanation goes here
 
@@ -14,6 +18,10 @@ function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTr
     pLeapsecondsMatrix ...
 );
 
+%OB% 20221018  The above function call passes the Sosos' AppliedSoundspeed to artoa.offsets.createCalculationTables
+%If it is NaN, solve does not work, unclear if tables are %constructed nevertheless.  Why should the Soso's sound speed be mandatory
+%and not a fitting parameter?
+
 %% Subtract all known offsets
 [B] = artoa.offsets.subtractKnownOffsets( ...
     unfilteredA, ...
@@ -51,6 +59,24 @@ end
 %% Solve it!
 X = A{:, :} \ B.toa;
 
+% Olaf Boebel 2022 11 03
+% the above solves the liner equation system if solvable.  However, due to
+% noise this is not necessarily the case.   Rather, we seek to find a
+% solution which minimizes the differnce between the found solution and the
+% true solution. This is given by: 
+
+H = A{:, :};
+B2 = H'*B.toa;
+A2 = H'*H;
+X2 = A2\B2;
+DET = det(A2)
+CONDITION = rcond(A2)
+[X X2]
+
+X = X2;  
+
+% End Olaf Boebel 2022 11 03 
+
 %% Apply row names to X
 if isrow(X)
     X = X';
@@ -65,5 +91,8 @@ for i = 1:length(varNames)
     end
 end
 
+%OB% 20221007
+soundspeed = pOffsetsParameter.offsets{'Float', 'AppliedSoundspeed'};   
+
 end