diff --git a/+math/calculateSteps.m b/+math/calculateSteps.m
index bb695b68b7bcba7ed58928e0637f647ec47e3ac8..12c587315e9a57330674acc3e36c38da985d881b 100644
--- a/+math/calculateSteps.m
+++ b/+math/calculateSteps.m
@@ -47,4 +47,7 @@ for iStep = steps
     data = math.intSignals(data, calibration, iStep);
 
 end
+
+% Store the processed data in the original structure.
+dataStruct.(trialName) = data;
 end
\ No newline at end of file
diff --git a/Main.m b/Main.m
index 53dcd0aa0957955e8d533e47b3d2ebdbeaf210fa..3e201a07efde91f7f0e5da8ca1a8af6dcd43204a 100644
--- a/Main.m
+++ b/Main.m
@@ -30,8 +30,11 @@ for i = 3:length(subjectFolders)
         dataStruct.(subjectFolders(i).name).(trialName) = readDotCsv(currentPath);
 
         % calculate all values for each step.
-        dataStruct.(subjectFolders(i).name).(trialName) = ...
+        dataStruct.(subjectFolders(i).name) = ...
             math.calculateSteps(dataStruct.(subjectFolders(i).name), trialName);
 
     end
-end
\ No newline at end of file
+end
+
+% Store the data in a results mat file.
+save(join([fileFolder '\Results.mat'],''), 'dataStruct')
\ No newline at end of file
diff --git a/getCalibration.m b/getCalibration.m
index 9375003bf362d0a35e8453d70dee04d7d3a7dda3..48f63f13ff956054a42ba1cddba71a84160b2481 100644
--- a/getCalibration.m
+++ b/getCalibration.m
@@ -27,12 +27,7 @@ function dataStruct = getCalibration(filePath)
         end
 
         % Determine the calibration orientation.
-        dataStruct.(trialName) = math.initOrien(dataStruct.(trialName));
-
-        
-
-        
+        dataStruct.(trialName) = math.initOrien(dataStruct.(trialName));       
 
     end
-
 end
\ No newline at end of file