Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java	(revision 1707)
+++ branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/ObjectDistanceSubstitionMatrix.java	(revision 1711)
@@ -3,7 +3,4 @@
 import java.io.Serializable;
 import java.util.HashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -97,33 +94,64 @@
 			}
 			this.updateEventTaskInstances(newTasks);
-			
-			int nThreads = de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.nThreads;
-			ExecutorService executor = Executors.newFixedThreadPool(nThreads);
-			
-			      
-			int count=0;
-			int size=uniqueTasks.size();
-			
 			for(Iterator<ITask> it = newTasks.iterator();it.hasNext();) {
 				ITask task1 = it.next();
 				for (Iterator<ITask> jt = uniqueTasks.iterator(); jt.hasNext();) {
 					ITask task2 = jt.next();
-					Runnable worker = new DistanceCalculator(task1,task2);
-				    executor.execute(worker);
+					computeDistance(task1,task2);
 				}
 			}
-			
-			 executor.shutdown();
-			    // Wait until all threads are finish
-			 try {
-				executor.awaitTermination(60, TimeUnit.MINUTES);
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-			 System.out.println("Finished all threads");
-			
-		}
-	}
-
+		}
+	}
+
+	private void computeDistance(ITask task1, ITask task2) {
+		int index1 = -1;
+		int index2 = -1;
+		float distance = 0;
+		ITaskInstance ti1 = null;
+		ITaskInstance ti2 = null;
+		// We just need to the first instance here
+		if (task1.getInstances().size() > 0) {
+			ti1 = (ITaskInstance) task1.getInstances().iterator()
+					.next();
+		}
+		if (task2.getInstances().size() > 0) {
+			ti2 = (ITaskInstance) task2.getInstances().iterator()
+					.next();
+		}
+		IEventTaskInstance eti1 = null;
+		IEventTaskInstance eti2 = null;
+
+		if (ti1 instanceof IEventTaskInstance
+				&& ti2 instanceof IEventTaskInstance) {
+			eti1 = (IEventTaskInstance) ti1;
+			index1 = getIndex(eti1);
+			eti2 = (IEventTaskInstance) ti2;
+			index2 = getIndex(eti2);
+			distance = distanceBetweenInstances(eti1, eti2);
+		} else if (ti1 instanceof IEventTaskInstance
+				&& !(ti2 instanceof IEventTaskInstance)) {
+			task1 = ((ITaskInstance) ti1).getTask();
+			index2 = getIndex(task2);
+			eti1 = (IEventTaskInstance) ti1;
+			index1 = getIndex(eti1);
+			distance = distanceBetweenTaskAndInstance(task2, eti1);
+		} else if (!(ti1 instanceof IEventTaskInstance)
+				&& ti2 instanceof IEventTaskInstance) {
+			index1 = getIndex(task1);
+			eti2 = (IEventTaskInstance) ti2;
+			index2 = getIndex(eti2);
+			distance = distanceBetweenTaskAndInstance(task1, eti2);
+		} else if (!(ti1 instanceof IEventTaskInstance)
+				&& !(ti2 instanceof IEventTaskInstance)) {
+			index1 = getIndex(task1);
+			index2 = getIndex(task2);
+			distance = distanceBetweenTasks(task1, task2);
+		} else {
+			System.out.println("Unknown error");
+		}
+		matrix.set(index1, index2, distance);
+	}
+	
+	
 	public void generate(HashSet<ITask> uniqueTasks) {
 		this.uniqueTasks = uniqueTasks;
@@ -137,10 +165,4 @@
 		}
 		matrix.initialize(0);
-		
-		
-		int nThreads = de.ugoe.cs.autoquest.tasktrees.temporalrelation.SequenceForTaskDetectionRuleAlignment.nThreads;
-		Console.traceln(Level.INFO, "calculating distances with " + nThreads + " threads");
-		ExecutorService executor = Executors.newFixedThreadPool(nThreads);
-		
 		      
 		int count=0;
@@ -149,22 +171,12 @@
 			ITask task1 = it.next();
 			count++;
-			if((size%count*100)==0) {
+			if((count%(size/100)==0)) {
 				Console.traceln(Level.INFO,(Math.round((float) count/size*100))+ "%");
 			}
 			for (Iterator<ITask> jt = uniqueTasks.iterator(); jt.hasNext();) {
 				ITask task2 = jt.next();
-				Runnable worker = new DistanceCalculator(task1,task2);
-			    executor.execute(worker);
-			}
-		}
-		 executor.shutdown();
-		    // Wait until all threads are finish
-		 try {
-			executor.awaitTermination(60, TimeUnit.MINUTES);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		 System.out.println("Finished all threads");
-		
+				computeDistance(task1,task2);
+			}
+		}
 		this.firstRoundMaxIndex=index;
 	}
@@ -280,74 +292,3 @@
 
 	}
-	
-	
-	private class DistanceCalculator implements Runnable {
-
-		private ITask task1;
-		private ITask task2;
-		
-		public DistanceCalculator(ITask task1, ITask task2){
-			this.task1 = task1;
-			this.task2 = task2;
-		}
-		
-		
-		@Override
-		public void run() {
-			computeDistance(task1,task2);
-		}
-		private void computeDistance(ITask task1, ITask task2) {
-			int index1 = -1;
-			int index2 = -1;
-			float distance = 0;
-			ITaskInstance ti1 = null;
-			ITaskInstance ti2 = null;
-			// We just need to the first instance here
-			if (task1.getInstances().size() > 0) {
-				ti1 = (ITaskInstance) task1.getInstances().iterator()
-						.next();
-			}
-			if (task2.getInstances().size() > 0) {
-				ti2 = (ITaskInstance) task2.getInstances().iterator()
-						.next();
-			}
-			IEventTaskInstance eti1 = null;
-			IEventTaskInstance eti2 = null;
-
-			if (ti1 instanceof IEventTaskInstance
-					&& ti2 instanceof IEventTaskInstance) {
-				eti1 = (IEventTaskInstance) ti1;
-				index1 = getIndex(eti1);
-				eti2 = (IEventTaskInstance) ti2;
-				index2 = getIndex(eti2);
-				distance = distanceBetweenInstances(eti1, eti2);
-			} else if (ti1 instanceof IEventTaskInstance
-					&& !(ti2 instanceof IEventTaskInstance)) {
-				task1 = ((ITaskInstance) ti1).getTask();
-				index2 = getIndex(task2);
-				eti1 = (IEventTaskInstance) ti1;
-				index1 = getIndex(eti1);
-				distance = distanceBetweenTaskAndInstance(task2, eti1);
-			} else if (!(ti1 instanceof IEventTaskInstance)
-					&& ti2 instanceof IEventTaskInstance) {
-				index1 = getIndex(task1);
-				eti2 = (IEventTaskInstance) ti2;
-				index2 = getIndex(eti2);
-				distance = distanceBetweenTaskAndInstance(task1, eti2);
-			} else if (!(ti1 instanceof IEventTaskInstance)
-					&& !(ti2 instanceof IEventTaskInstance)) {
-				index1 = getIndex(task1);
-				index2 = getIndex(task2);
-				distance = distanceBetweenTasks(task1, task2);
-			} else {
-				System.out.println("Unknown error");
-			}
-			matrix.set(index1, index2, distance);
-			//return distance;
-			
-		}
-		
-		
-	}
-
 }
Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/PairwiseAlignmentGenerator.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/PairwiseAlignmentGenerator.java	(revision 1707)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package de.ugoe.cs.autoquest.tasktrees.alignment.matrix;
-
-import java.util.ArrayList;
-import java.util.logging.Level;
-
-import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm;
-import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithmFactory;
-import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.NumberSequence;
-import de.ugoe.cs.util.console.Console;
-
-public class PairwiseAlignmentGenerator {
-
-	public static PairwiseAlignmentStorage generate(
-			ArrayList<NumberSequence> numberseqs,
-			ObjectDistanceSubstitionMatrix submat, 
-			int threshold) {
-		PairwiseAlignmentStorage alignments = new PairwiseAlignmentStorage(
-				numberseqs.size(), numberseqs.size());
-		int smithWatermanThreshold = threshold;
-
-		for (int i = 0; i < numberseqs.size(); i++) {
-			NumberSequence ns1 = numberseqs.get(i);
-			for (int j = 0; j < numberseqs.size(); j++) {
-				NumberSequence ns2 = numberseqs.get(j);
-
-				if (i != j) {
-					Console.traceln(Level.FINEST,"Aligning sequence " + i + " with sequence " + j);
-				
-					AlignmentAlgorithm aa = AlignmentAlgorithmFactory.create();
-					aa.align(ns1, ns2, submat,
-							smithWatermanThreshold);
-					alignments.set(i, j, aa);
-				}
-			}
-		}
-		return alignments;
-	}
-}
Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/PairwiseAlignmentStorage.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/PairwiseAlignmentStorage.java	(revision 1707)
+++ 	(revision )
@@ -1,42 +1,0 @@
-package de.ugoe.cs.autoquest.tasktrees.alignment.matrix;
-
-
-
-
-import de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.AlignmentAlgorithm;
-
-
-public class PairwiseAlignmentStorage {
-
-    private AlignmentAlgorithm[][] alignments;
-    private UPGMAMatrix sequenceDistances;
-   
-    public PairwiseAlignmentStorage(int sizex, int sizey) {
-    	alignments = new AlignmentAlgorithm[sizex+1][sizey+1];
-    	sequenceDistances = new UPGMAMatrix(Math.max(sizex,sizey));
-    	sequenceDistances.initialize(Float.POSITIVE_INFINITY);
-    }
- 
-    
-    
-    public void set(int i,int j,AlignmentAlgorithm sw) {
-    	alignments[i][j] = sw;
-    }
-    
-    public AlignmentAlgorithm get(int i,int j) {
-    	return alignments[i][j];
-    }
-    
-    public void setDistance(int i,int j,float distance) {
-    	sequenceDistances.set(i, j, distance);
-    }
-    
-    public double getDistance(int i,int j) {
-    	return sequenceDistances.get(i,j);
-    }
-    
-    public UPGMAMatrix getDistanceMatrix() {
-    	return sequenceDistances;
-    }
-}
-
