Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 12231)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 12265)
@@ -1,3 +1,3 @@
-﻿#region License Information
+﻿#region License information
 /* HeuristicLab
  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 12231)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 12265)
@@ -155,22 +155,4 @@
                 traceCache.Add(t1);
               }
-              // gather statistics about sampled individuals and sampled subtrees
-              if (UpdateVertexWeights)
-                n.Weight++;
-              if (UpdateSubtreeWeights) {
-                var arcs = (List<IArc>)((IVertex)n).InArcs; // at this moment n will have been added as a child to the next trace node
-
-                // TODO: try to simplify the code below
-                for (int i = 0; i < arcs.Count; ++i) {
-                  var td = (TraceData)((IArc<IDeepCloneable>)arcs[i]).Data;
-                  var p = (IGenealogyGraphNode<ISymbolicExpressionTree>)arcs[i].Source;
-                  var s = NodeAt(p.Data, td.SubtreeIndex);
-                  if (td.LastFragmentIndex == td.SubtreeIndex && fragment.Root.Difference(s) == null) {
-                    foreach (var ss in s.IterateNodesPrefix()) ss.NodeWeight++; // the node weight will represent the total sample count for a given node
-                    arcs[i].Weight++; // the arc weights (since there are multiple arcs) will sum up to the same count but give more detail
-                    break;
-                  }
-                }
-              }
               break;
             } else {
@@ -197,6 +179,4 @@
               traceCache.Add(t);
             }
-            if (UpdateVertexWeights)
-              n.Weight++;
             break;
           } else {
@@ -257,17 +237,26 @@
     /// <param name="si">The index of the traced subtree</param>
     /// <param name="fi">The index of the fragment</param>
-    private void ConnectLast(IGenealogyGraphNode<ISymbolicExpressionTree> current,
-      IGenealogyGraphNode<ISymbolicExpressionTree> last, int si, int fi) {
+    private void ConnectLast(IGenealogyGraphNode<ISymbolicExpressionTree> current, IGenealogyGraphNode<ISymbolicExpressionTree> last, int si, int fi) {
       var lastTraceData = traceMap[last];
       int lastSi = lastTraceData.SubtreeIndex; // last subtree index (index of the traced subtree in the previous trace node)
       int lastFi = lastTraceData.FragmentIndex; // last fragment index (index of the fragment in the previous trace node)
       var td = new TraceData(si, fi, lastSi, lastFi); // trace data
-      // using the inArcs seems to be slightly more efficient than using the outArcs
+
       // TODO: more testing
-      var inArcs = (List<IArc>)((IVertex)last).InArcs;
+      var inArcs = (List<IArc>)((IVertex)last).InArcs; // using the InArcs seems to be slightly more efficient than using the OutArcs
       var arc = inArcs.FirstOrDefault(a => a.Source == current && ((IArc<IDeepCloneable>)a).Data.Equals(td));
       if (arc == null) {
         arc = new GenealogyGraphArc(current, last) { Data = td };
         TraceGraph.AddArc(arc);
+      } else {
+        if (UpdateVertexWeights) {
+          arc.Weight++;
+          current.Weight++;
+        }
+        if (UpdateSubtreeWeights) {
+          var subtree = NodeAt(current.Data, td.SubtreeIndex);
+          foreach (var s in subtree.IterateNodesPrefix())
+            s.NodeWeight++;
+        }
       }
     }
