Index: /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
===================================================================
--- /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs	(revision 12849)
+++ /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs	(revision 12850)
@@ -175,10 +175,7 @@
         varNames.Add(((VariableTreeNode)node).VariableName);
       }
-      foreach (var varName in varNames) {
-        strBuilder.Append("double " + varName);
-        if (varName != varNames.Last()) {
-          strBuilder.Append(", ");
-        }
-      }
+
+      var orderedNames = varNames.OrderBy(n => n, new NaturalStringComparer()).Select(n=> "double " + n);
+      strBuilder.Append(string.Join(", ", orderedNames));
 
       strBuilder.AppendLine(") {");
Index: /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs
===================================================================
--- /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 12849)
+++ /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisImpactValuesCalculator.cs	(revision 12850)
@@ -6,7 +6,7 @@
   public interface ISymbolicDataAnalysisSolutionImpactValuesCalculator : IItem {
     double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows);
-    double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN);
+    double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double qualityForImpactsCalculation = double.NaN);
     void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData,
-      IEnumerable<int> rows, out double impactValue, out double replacementValue, double originalQuality = double.NaN);
+      IEnumerable<int> rows, out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation, double qualityForImpactsCalculation = double.NaN);
   }
 }
Index: /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs
===================================================================
--- /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 12849)
+++ /branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 12850)
@@ -65,10 +65,12 @@
 
       OnlineCalculatorError error;
-      var r2 = OnlinePearsonsRSquaredCalculator.Calculate(v1, v2, out error);
+      var r = OnlinePearsonsRCalculator.Calculate(v1, v2, out error);
+
+      var r2 = error == OnlineCalculatorError.None ? r * r : 0;
 
       if (r2 > 1.0)
         r2 = 1.0;
 
-      return error == OnlineCalculatorError.None ? r2 : 0;
+      return r2;
     }
 
@@ -87,10 +89,12 @@
 
       OnlineCalculatorError error;
-      var r2 = OnlinePearsonsRSquaredCalculator.Calculate(leftValues, rightValues, out error);
+      var r = OnlinePearsonsRCalculator.Calculate(leftValues, rightValues, out error);
+
+      var r2 = error == OnlineCalculatorError.None ? r * r : 0;
 
       if (r2 > 1.0)
-        r2 = 1.0; // sometimes due to fp errors it can happen that the r2 is over 1 (like 1.0000000009)
+        r2 = 1.0;
 
-      return error == OnlineCalculatorError.None ? r2 : 0;
+      return r2;
     }
   }
