Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 14767)
@@ -331,5 +331,9 @@
     <Compile Include="Interfaces\ISupportVectorMachineSolution.cs" />
     <Compile Include="Interfaces\IDataAnalysisAlgorithm.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\IKernelFunction.cs" />
+    <Compile Include="Interfaces\TSNEInterfaces\ICell.cs" />
+    <Compile Include="Interfaces\TSNEInterfaces\IDataPoint.cs" />
+    <Compile Include="Interfaces\TSNEInterfaces\IDistance.cs" />
+    <Compile Include="Interfaces\TSNEInterfaces\ISPTree.cs" />
+    <Compile Include="Interfaces\TSNEInterfaces\IVPTree.cs" />
     <Compile Include="kMeans\KMeansClustering.cs" />
     <Compile Include="kMeans\KMeansClusteringModel.cs" />
@@ -416,9 +420,7 @@
     <Compile Include="TSNE\Cell.cs" />
     <Compile Include="TSNE\DataPoint.cs" />
-    <Compile Include="TSNE\Distances\FuctionalDistance.cs" />
     <Compile Include="TSNE\Distances\DistanceBase.cs" />
     <Compile Include="TSNE\Distances\DataPointDistance.cs" />
     <Compile Include="TSNE\Distances\EuclidianDistance.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\IDistance.cs" />
     <Compile Include="TSNE\Distances\InnerProductDistance.cs" />
     <Compile Include="TSNE\TSNEAnalysis.cs" />
@@ -426,10 +428,4 @@
     <Compile Include="TSNE\SPtree.cs" />
     <Compile Include="TSNE\TSNE.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\ICell.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\IDataPoint.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\IHeap.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\ISPTree.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\ITSNE.cs" />
-    <Compile Include="Interfaces\TSNEInterfaces\IVPTree.cs" />
     <Compile Include="TSNE\TSNEUtils.cs" />
     <Compile Include="TSNE\VPTree.cs" />
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IDistance.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IDistance.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IDistance.cs	(revision 14767)
@@ -26,23 +26,11 @@
   public interface IDistance<in T> : IItem {
     /// <summary>
-    /// Calculates a distance measure between two arbitrary Vectors. The distance value d is 
-    /// 1.) positive  d(x,y)>=0
+    /// Calculates a distance measure between two objects.
+    /// 1.) non-negative d(x,y) >= 0
     /// 2.) symmetric d(x,y) = d(y,x)
-    /// 3.) zero-reflexive d(x,x) =0;
+    /// 3.) zero-reflexive d(x,x) = 0;
     /// </summary>
-    /// <param name="a">an array representing point x</param>
-    /// <param name="b">>an array representing point y</param>
     /// <returns>d(x,y)</returns>
-    double Get(T a, T b);
-
-    /// <summary>
-    /// Calculates the correct kernel measure if it is smaller than threshold, but any value greater then threshold if the correct distance is greater.
-    /// This is for performace only
-    /// </summary>
-    /// <param name="a"></param>
-    /// <param name="b"></param>
-    /// <param name="threshold"></param>
-    /// <returns></returns>
-    double Get(T a, T b, double threshold);
+    double Get(T x, T y);
 
     /// <summary>
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IHeap.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IHeap.cs	(revision 14742)
+++ 	(revision )
@@ -1,34 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
-* Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
-*
-* This file is part of HeuristicLab.
-*
-* HeuristicLab is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* HeuristicLab is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#endregion
-
-using System.Collections.Generic;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  public interface IHeap<TK, TV> {
-    int Size { get; }
-    KeyValuePair<TK, TV> PeekMin();
-    TK PeekMinKey();
-    TV PeekMinValue();
-    void Insert(TK key, TV value);
-    void RemoveMin();
-  }
-}
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IKernelFunction.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/IKernelFunction.cs	(revision 14742)
+++ 	(revision )
@@ -1,36 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  public interface IKernelFunction<in T> : ICovarianceFunction {
-    /// <summary>
-    /// Calculates a kernel measure between two aribitrary Vectors. The distance value d is 
-    /// 1.) positive  d(x,y)>0
-    /// 2.) symmetric d(x,y) = d(y,x)
-    /// 3.) only dependent on the norm ||x-y|| (Radial Basis criterium)
-    /// </summary>
-    /// <param name="a">an array representing point x</param>
-    /// <param name="b">>an array representing point y</param>
-    /// <returns>d(x,y)</returns>
-    double Get(T a, T b);
-  }
-}
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/ITSNE.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/TSNEInterfaces/ITSNE.cs	(revision 14742)
+++ 	(revision )
@@ -1,28 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  public interface ITSNE<in T> : IDeepCloneable {
-    double[,] Run(T[] data, int newDimensions, double perplexity, double theta);
-  }
-}
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/DataPoint.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/DataPoint.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/DataPoint.cs	(revision 14767)
@@ -88,6 +88,4 @@
     #endregion
 
-
-
   }
 }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DataPointDistance.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DataPointDistance.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DataPointDistance.cs	(revision 14767)
@@ -49,8 +49,4 @@
       return dist.Get(a.X, b.X);
     }
-
-    public override double Get(IDataPoint<T> a, IDataPoint<T> b, double threshold) {
-      return dist.Get(a.X, b.X, threshold);
-    }
   }
 }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DistanceBase.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DistanceBase.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/DistanceBase.cs	(revision 14767)
@@ -37,5 +37,4 @@
 
     public abstract double Get(T a, T b);
-    public abstract double Get(T a, T b, double threshold);
 
     public IComparer<T> GetDistanceComparer(T item) {
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/EuclidianDistance.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/EuclidianDistance.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/EuclidianDistance.cs	(revision 14767)
@@ -45,16 +45,4 @@
       return Math.Sqrt(point1.Zip(point2, (a1, b1) => (a1 - b1) * (a1 - b1)).Sum());
     }
-    public static double GetDistance(IEnumerable<double> a, IEnumerable<double> b, double threshold) {
-      double sum = 0;
-      var it1 = a.GetEnumerator();
-      var it2 = b.GetEnumerator();
-      while (sum > threshold * threshold && it1.MoveNext() && it2.MoveNext()) {
-        var d = it1.Current - it2.Current;
-        sum += d * d;
-      }
-      it1.Dispose();
-      it2.Dispose();
-      return sum;
-    }
     #endregion
 
@@ -62,7 +50,4 @@
       return GetDistance(a.ToArray(), b.ToArray());
     }
-    public override double Get(IEnumerable<double> a, IEnumerable<double> b, double threshold) {
-      return GetDistance(a, b, threshold);
-    }
   }
 }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/FuctionalDistance.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/FuctionalDistance.cs	(revision 14742)
+++ 	(revision )
@@ -1,58 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.DataAnalysis {
-  [StorableClass]
-  [Item("FuctionalDistance", "A distance wrapper for DataPoints")]
-  internal class FuctionalDistance<T> : DistanceBase<T> where T : class {
-
-    #region properties
-    [Storable]
-    private Func<T, T, double> dist;
-    #endregion
-
-    #region HLConstructors & Cloning
-    [StorableConstructor]
-    protected FuctionalDistance(bool deserializing) : base(deserializing) { }
-    protected FuctionalDistance(FuctionalDistance<T> original, Cloner cloner) : base(original, cloner) {
-      dist = original.dist; //func needs to be stateless
-    }
-    public override IDeepCloneable Clone(Cloner cloner) { return new FuctionalDistance<T>(this, cloner); }
-    public FuctionalDistance(Func<T, T, double> distance) {
-      dist = distance;
-    }
-    #endregion
-
-    public override double Get(T a, T b) {
-      return dist.Invoke(a, b);
-    }
-
-    public override double Get(T a, T b, double threshold) {
-      return Get(a, b);   //no threshold evaluation here
-    }
-  }
-}
-
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/InnerProductDistance.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/InnerProductDistance.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/InnerProductDistance.cs	(revision 14767)
@@ -30,9 +30,10 @@
 
   /// <summary>
-  /// this is not a proper distance 
+  /// The angluar distance as defined as a normalized distance measure dependent on the angle between two vectors.
+  /// It is designed for vectors with all positive coordinates.
   /// </summary>
   [StorableClass]
-  [Item("InnerProductDistance", "The Angluar Distance as defined as a normalized distance measure dependent on the angle between two vectors.\nIt is designed for vectors with all positive coordinates")]
-  public class InnerProductDistance : DistanceBase<IReadOnlyList<double>> {
+  [Item("InnerProductDistance", "The angluar distance as defined as a normalized distance measure dependent on the angle between two vectors.\nIt is designed for vectors with all positive coordinates")]
+  public class InnerProductDistance : DistanceBase<IEnumerable<double>> {
 
     #region HLConstructors
@@ -48,17 +49,18 @@
 
     #region statics
-    public static double GetDistance(IReadOnlyList<double> point1, IReadOnlyList<double> point2) {
-      if (point1.Count != point2.Count) throw new ArgumentException("Inner Product distance not defined on vectors of different length");
-      return point1.Zip(point2, (x, y) => x * y).Sum();
-    }
-    public static double GetDistance(IEnumerable<double> a, IEnumerable<double> b, double threshold) {
-      return GetDistance(a.ToArray(), b.ToArray());     //no shortcut evaluation for Inner Product (summands may be negative => no way of telling if threshold is reached or not)
+    public static double GetDistance(IEnumerable<double> point1, IEnumerable<double> point2) {
+      var xs = point1.GetEnumerator();
+      var ys = point2.GetEnumerator();
+      var sum = 0.0;
+      while(xs.MoveNext() & ys.MoveNext()) {
+        if(xs.Current < 0 || ys.Current < 0) throw new ArgumentException("Inner product distance is only defined for vectors with non-negative elements");
+        sum += xs.Current * ys.Current;
+      }
+      if(xs.MoveNext() || ys.MoveNext()) throw new ArgumentException("Enumerables contain a different number of elements");
+      return sum;
     }
     #endregion
-    public override double Get(IReadOnlyList<double> a, IReadOnlyList<double> b) {
+    public override double Get(IEnumerable<double> a, IEnumerable<double> b) {
       return GetDistance(a, b);
-    }
-    public override double Get(IReadOnlyList<double> a, IReadOnlyList<double> b, double threshold) {
-      return GetDistance(a, b, threshold);
     }
   }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/PriorityQueue.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/PriorityQueue.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/PriorityQueue.cs	(revision 14767)
@@ -29,5 +29,5 @@
   // implementation based on C++ version from Peter Sanders
   // http://www.mpi-inf.mpg.de/~sanders/programs/spq/
-  public sealed class PriorityQueue<TK, TV> : IHeap<TK, TV> where TK : IComparable {
+  public sealed class PriorityQueue<TK, TV> where TK : IComparable {
     private class KNElement {
       public TK Key { get; set; }
@@ -35,10 +35,10 @@
     }
 
-    private int capacity;
+    private readonly int capacity;
     private int size; // index of last used element
     private int finalLayerSize; // size of first layer with free space
     private int finalLayerDist; // distance to end of layer
                                 //private KNElement[] rawData;
-    private KNElement[] data;    // alligned version of rawData
+    private readonly KNElement[] data;    // aligned version of rawData
 
     public PriorityQueue(TK supremum, TK infimum, int cap) {
@@ -53,16 +53,14 @@
     }
 
-    public int Size
-    {
+    public int Size {
       get { return size; }
     }
 
-    public TK Supremum
-    {
+    public TK Supremum {
       get { return data[capacity + 1].Key; }
     }
 
     public KeyValuePair<TK, TV> PeekMin() {
-      if (size == 0) {
+      if(size == 0) {
         throw new InvalidOperationException("Heap is empty");
       }
@@ -87,25 +85,25 @@
       size = sz - 1;
       finalLayerDist++;
-      if (finalLayerDist == finalLayerSize) {
+      if(finalLayerDist == finalLayerSize) {
         finalLayerSize >>= 2;
         finalLayerDist = 0;
       }
 
-      while (succ < sz) {
+      while(succ < sz) {
         var minKey = data[succ].Key;
         var delta = 0;
 
         var otherKey = data[succ + 1].Key;
-        if (otherKey.CompareTo(minKey) < 0) {
+        if(otherKey.CompareTo(minKey) < 0) {
           minKey = otherKey;
           delta = 1;
         }
         otherKey = data[succ + 2].Key;
-        if (otherKey.CompareTo(minKey) < 0) {
+        if(otherKey.CompareTo(minKey) < 0) {
           minKey = otherKey;
           delta = 2;
         }
         otherKey = data[succ + 3].Key;
-        if (otherKey.CompareTo(minKey) < 0) {
+        if(otherKey.CompareTo(minKey) < 0) {
           minKey = otherKey;
           delta = 3;
@@ -137,5 +135,5 @@
       pred = pred - layerDist; // finally preds index
 
-      while (data[pred].Key.CompareTo(bubble) > 0) {  // must terminate since inf at root
+      while(data[pred].Key.CompareTo(bubble) > 0) {  // must terminate since inf at root
         data[hole].Key = data[pred].Key;
         data[hole].Value = data[pred].Value;
@@ -159,6 +157,6 @@
       finalLayerDist--;
 
-      if (finalLayerDist == -1) { // layer full
-                                  // start next layer
+      if(finalLayerDist == -1) { // layer full
+                                 // start next layer
         finalLayerSize <<= 2;
         finalLayerDist = finalLayerSize - 1;
@@ -173,5 +171,5 @@
       pred = pred - layerDist; // finally preds index
       var predKey = data[pred].Key;
-      while (predKey.CompareTo(key) > 0) {
+      while(predKey.CompareTo(key) > 0) {
         data[hole].Key = predKey;
         data[hole].Value = data[pred].Value;
@@ -196,5 +194,5 @@
       var sup = Supremum;
       var cap = capacity;
-      for (var i = 1; i <= cap; i++) {
+      for(var i = 1; i <= cap; i++) {
         data[i].Key = sup;
       }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNE.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNE.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNE.cs	(revision 14767)
@@ -67,5 +67,5 @@
 namespace HeuristicLab.Algorithms.DataAnalysis {
   [StorableClass]
-  public class TSNE<T> : DeepCloneable, ITSNE<T> where T : class, IDeepCloneable {
+  public class TSNE<T> : DeepCloneable where T : class, IDeepCloneable {
 
     private const string IterationResultName = "Iteration";
@@ -192,7 +192,4 @@
       return new TSNE<TR>(distance, random).Run(data, newDimensions, perplexity, theta);
     }
-    public static double[,] Run<TR>(TR[] data, int newDimensions, double perplexity, double theta, Func<TR, TR, double> distance, IRandom random) where TR : class, IDeepCloneable {
-      return new TSNE<TR>(new FuctionalDistance<TR>(distance), random).Run(data, newDimensions, perplexity, theta);
-    }
 
     #region helpers
@@ -224,5 +221,5 @@
       if (results == null) return;
       var plot = results[ErrorPlotResultName].Value as DataTable;
-      if (plot == null) throw new ArgumentException("Could not create/access Error-DataTable in Results-Collection. Was it removed by some effect?");
+      if (plot == null) throw new ArgumentException("Could not create/access error data table in results collection. Was it removed by some effect?");
       var errors = plot.Rows["errors"].Values;
       var c = exact
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAnalysis.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAnalysis.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAnalysis.cs	(revision 14767)
@@ -38,20 +38,19 @@
 namespace HeuristicLab.Algorithms.DataAnalysis {
   /// <summary>
-  /// Linear regression data analysis algorithm.
+  /// t-distributed stochastic neighbourhood embedding (TSNE) projects the data in a low dimensional 
+  /// space to allow visual cluster identification.
   /// </summary>
-  [Item("TSNE", "t-distributed stochastic neighbourhood embedding projects the data in a low dimensional space to allow visual cluster identification")]
+  [Item("TSNE", "t-distributed stochastic neighbourhood embedding projects the data in a low " +
+                "dimensional space to allow visual cluster identification.")]
   [Creatable(CreatableAttribute.Categories.DataAnalysis, Priority = 100)]
   [StorableClass]
   public sealed class TSNEAnalysis : BasicAlgorithm {
-    public override bool SupportsPause
-    {
+    public override bool SupportsPause {
       get { return false; }
     }
-    public override Type ProblemType
-    {
+    public override Type ProblemType {
       get { return typeof(IDataAnalysisProblem); }
     }
-    public new IDataAnalysisProblem Problem
-    {
+    public new IDataAnalysisProblem Problem {
       get { return (IDataAnalysisProblem)base.Problem; }
       set { base.Problem = value; }
@@ -76,58 +75,44 @@
 
     #region Parameterproperties
-    public IFixedValueParameter<DoubleValue> PerplexityParameter
-    {
+    public IFixedValueParameter<DoubleValue> PerplexityParameter {
       get { return Parameters[PerplexityParameterName] as IFixedValueParameter<DoubleValue>; }
     }
-    public OptionalValueParameter<DoubleValue> ThetaParameter
-    {
+    public OptionalValueParameter<DoubleValue> ThetaParameter {
       get { return Parameters[ThetaParameterName] as OptionalValueParameter<DoubleValue>; }
     }
-    public IFixedValueParameter<IntValue> NewDimensionsParameter
-    {
+    public IFixedValueParameter<IntValue> NewDimensionsParameter {
       get { return Parameters[NewDimensionsParameterName] as IFixedValueParameter<IntValue>; }
     }
-    public IValueParameter<IDistance<RealVector>> DistanceParameter
-    {
+    public IValueParameter<IDistance<RealVector>> DistanceParameter {
       get { return Parameters[DistanceParameterName] as IValueParameter<IDistance<RealVector>>; }
     }
-    public IFixedValueParameter<IntValue> MaxIterationsParameter
-    {
+    public IFixedValueParameter<IntValue> MaxIterationsParameter {
       get { return Parameters[MaxIterationsParameterName] as IFixedValueParameter<IntValue>; }
     }
-    public IFixedValueParameter<IntValue> StopLyingIterationParameter
-    {
+    public IFixedValueParameter<IntValue> StopLyingIterationParameter {
       get { return Parameters[StopLyingIterationParameterName] as IFixedValueParameter<IntValue>; }
     }
-    public IFixedValueParameter<IntValue> MomentumSwitchIterationParameter
-    {
+    public IFixedValueParameter<IntValue> MomentumSwitchIterationParameter {
       get { return Parameters[MomentumSwitchIterationParameterName] as IFixedValueParameter<IntValue>; }
     }
-    public IFixedValueParameter<DoubleValue> InitialMomentumParameter
-    {
+    public IFixedValueParameter<DoubleValue> InitialMomentumParameter {
       get { return Parameters[InitialMomentumParameterName] as IFixedValueParameter<DoubleValue>; }
     }
-    public IFixedValueParameter<DoubleValue> FinalMomentumParameter
-    {
+    public IFixedValueParameter<DoubleValue> FinalMomentumParameter {
       get { return Parameters[FinalMomentumParameterName] as IFixedValueParameter<DoubleValue>; }
     }
-    public IFixedValueParameter<DoubleValue> EtaParameter
-    {
+    public IFixedValueParameter<DoubleValue> EtaParameter {
       get { return Parameters[EtaParameterName] as IFixedValueParameter<DoubleValue>; }
     }
-    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter
-    {
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter {
       get { return Parameters[SetSeedRandomlyParameterName] as IFixedValueParameter<BoolValue>; }
     }
-    public IFixedValueParameter<IntValue> SeedParameter
-    {
+    public IFixedValueParameter<IntValue> SeedParameter {
       get { return Parameters[SeedParameterName] as IFixedValueParameter<IntValue>; }
     }
-    public IFixedValueParameter<StringValue> ClassesParameter
-    {
+    public IFixedValueParameter<StringValue> ClassesParameter {
       get { return Parameters[ClassesParameterName] as IFixedValueParameter<StringValue>; }
     }
-    public IFixedValueParameter<BoolValue> NormalizationParameter
-    {
+    public IFixedValueParameter<BoolValue> NormalizationParameter {
       get { return Parameters[NormalizationParameterName] as IFixedValueParameter<BoolValue>; }
     }
@@ -135,61 +120,46 @@
 
     #region  Properties
-    public IDistance<RealVector> Distance
-    {
+    public IDistance<RealVector> Distance {
       get { return DistanceParameter.Value; }
     }
-    public double Perplexity
-    {
+    public double Perplexity {
       get { return PerplexityParameter.Value.Value; }
     }
-    public double Theta
-    {
+    public double Theta {
       get { return ThetaParameter.Value == null ? 0 : ThetaParameter.Value.Value; }
     }
-    public int NewDimensions
-    {
+    public int NewDimensions {
       get { return NewDimensionsParameter.Value.Value; }
     }
-    public int MaxIterations
-    {
+    public int MaxIterations {
       get { return MaxIterationsParameter.Value.Value; }
     }
-    public int StopLyingIteration
-    {
+    public int StopLyingIteration {
       get { return StopLyingIterationParameter.Value.Value; }
     }
-    public int MomentumSwitchIteration
-    {
+    public int MomentumSwitchIteration {
       get { return MomentumSwitchIterationParameter.Value.Value; }
     }
-    public double InitialMomentum
-    {
+    public double InitialMomentum {
       get { return InitialMomentumParameter.Value.Value; }
     }
-    public double FinalMomentum
-    {
+    public double FinalMomentum {
       get { return FinalMomentumParameter.Value.Value; }
     }
-    public double Eta
-    {
-      get
-      {
+    public double Eta {
+      get {
         return EtaParameter.Value == null ? 0 : EtaParameter.Value.Value;
       }
     }
-    public bool SetSeedRandomly
-    {
+    public bool SetSeedRandomly {
       get { return SetSeedRandomlyParameter.Value.Value; }
     }
-    public uint Seed
-    {
+    public uint Seed {
       get { return (uint)SeedParameter.Value.Value; }
     }
-    public string Classes
-    {
+    public string Classes {
       get { return ClassesParameter.Value.Value; }
     }
-    public bool Normalization
-    {
+    public bool Normalization {
       get { return NormalizationParameter.Value.Value; }
     }
@@ -230,5 +200,5 @@
     public override void Stop() {
       base.Stop();
-      if (tsne != null) tsne.Running = false;
+      if(tsne != null) tsne.Running = false;
     }
 
@@ -239,17 +209,17 @@
 
       //color datapoints acording to Classes-Variable (be it double or string)
-      if (problemData.Dataset.VariableNames.Contains(Classes)) {
-        if ((problemData.Dataset as Dataset).VariableHasType<string>(Classes)) {
+      if(problemData.Dataset.VariableNames.Contains(Classes)) {
+        if((problemData.Dataset as Dataset).VariableHasType<string>(Classes)) {
           var classes = problemData.Dataset.GetStringValues(Classes).ToArray();
-          for (var i = 0; i < classes.Length; i++) {
-            if (!dataRowNames.ContainsKey(classes[i])) dataRowNames.Add(classes[i], new List<int>());
+          for(var i = 0; i < classes.Length; i++) {
+            if(!dataRowNames.ContainsKey(classes[i])) dataRowNames.Add(classes[i], new List<int>());
             dataRowNames[classes[i]].Add(i);
           }
-        } else if ((problemData.Dataset as Dataset).VariableHasType<double>(Classes)) {
+        } else if((problemData.Dataset as Dataset).VariableHasType<double>(Classes)) {
           var classValues = problemData.Dataset.GetDoubleValues(Classes).ToArray();
           var max = classValues.Max() + 0.1;
           var min = classValues.Min() - 0.1;
           const int contours = 8;
-          for (var i = 0; i < contours; i++) {
+          for(var i = 0; i < contours; i++) {
             var contourname = GetContourName(i, min, max, contours);
             dataRowNames.Add(contourname, new List<int>());
@@ -258,5 +228,5 @@
             rows[contourname].VisualProperties.PointSize = i + 3;
           }
-          for (var i = 0; i < classValues.Length; i++) {
+          for(var i = 0; i < classValues.Length; i++) {
             dataRowNames[GetContourName(classValues[i], min, max, contours)].Add(i);
           }
@@ -268,5 +238,5 @@
 
       //Set up and run TSNE
-      if (SetSeedRandomly) SeedParameter.Value.Value = new System.Random().Next();
+      if(SetSeedRandomly) SeedParameter.Value.Value = new System.Random().Next();
       var random = new MersenneTwister(Seed);
       tsne = new TSNE<RealVector>(Distance, random, Results, MaxIterations, StopLyingIteration, MomentumSwitchIteration, InitialMomentum, FinalMomentum, Eta, dataRowNames, rows);
@@ -274,6 +244,6 @@
       var allowedInputVariables = problemData.AllowedInputVariables.ToArray();
       var data = new RealVector[dataset.Rows];
-      for (var row = 0; row < dataset.Rows; row++) data[row] = new RealVector(allowedInputVariables.Select(col => dataset.GetDoubleValue(col, row)).ToArray());
-      if (Normalization) data = NormalizeData(data);
+      for(var row = 0; row < dataset.Rows; row++) data[row] = new RealVector(allowedInputVariables.Select(col => dataset.GetDoubleValue(col, row)).ToArray());
+      if(Normalization) data = NormalizeData(data);
       tsne.Run(data, NewDimensions, Perplexity, Theta);
     }
@@ -284,12 +254,12 @@
       var sd = new double[n];
       var nData = new RealVector[data.Count];
-      for (var i = 0; i < n; i++) {
+      for(var i = 0; i < n; i++) {
         var i1 = i;
         sd[i] = Enumerable.Range(0, data.Count).Select(x => data[x][i1]).StandardDeviation();
         mean[i] = Enumerable.Range(0, data.Count).Select(x => data[x][i1]).Average();
       }
-      for (var i = 0; i < data.Count; i++) {
+      for(var i = 0; i < data.Count; i++) {
         nData[i] = new RealVector(n);
-        for (var j = 0; j < n; j++) nData[i][j] = (data[i][j] - mean[j]) / sd[j];
+        for(var j = 0; j < n; j++) nData[i][j] = (data[i][j] - mean[j]) / sd[j];
       }
       return nData;
@@ -309,5 +279,4 @@
       return "[" + (min + i * size) + ";" + (min + (i + 1) * size) + ")";
     }
-
   }
 }
Index: branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/VPTree.cs
===================================================================
--- branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/VPTree.cs	(revision 14742)
+++ branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/VPTree.cs	(revision 14767)
@@ -99,5 +99,5 @@
 
     public void Search(T target, int k, out List<T> results, out List<double> distances) {
-      IHeap<double, HeapItem> heap = new PriorityQueue<double, HeapItem>(double.MaxValue, double.MinValue, k);
+      var heap = new PriorityQueue<double, HeapItem>(double.MaxValue, double.MinValue, k);
       tau = double.MaxValue;
       Search(root, target, k, heap);
@@ -142,10 +142,10 @@
     }
 
-    private void Search(Node node, T target, int k, IHeap<double, HeapItem> heap) {
+    private void Search(Node node, T target, int k, PriorityQueue<double, HeapItem> heap) {
       if (node == null) return;
       var dist = distance.Get(items[node.index], target);
       if (dist < tau) {
         if (heap.Size == k) heap.RemoveMin();
-        heap.Insert(-dist, new HeapItem(node.index, dist));//TODO check if minheap or maxheap schould be used here
+        heap.Insert(-dist, new HeapItem(node.index, dist));//TODO check if minheap or maxheap should be used here
         if (heap.Size == k) tau = heap.PeekMinValue().Dist;
       }
