Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java	(revision 1664)
+++ branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java	(revision 1666)
@@ -114,5 +114,5 @@
 		//	System.out.println(subsequence.getSequence().getChildren().get(i));	
 		//}
-		System.out.println();
+		//System.out.println();
 		//TODO: This is dirty!
 		missedOptionals=0;
@@ -129,5 +129,5 @@
 						
 					if(((IMarkingTemporalRelationship) tempTask).getMarkedTask() == parent.get(startIndex).getTask()) {
-						System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());
+						//System.out.println("Adding OptionalInstance " + parent.get(startIndex) + " to " + tempTask.getType());
 						IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask);
 						taskBuilder.setChild(optional, parent.get(startIndex));
@@ -135,5 +135,5 @@
 					}
 					else {
-						System.out.println("Adding Empty optional, not deleting anything from the input sequence");
+						//System.out.println("Adding Empty optional, not deleting anything from the input sequence");
 						IOptionalInstance optional = taskFactory.createNewTaskInstance((IOptional) tempTask);
 						taskBuilder.addChild(subsequence, optional);
@@ -143,5 +143,5 @@
 					}				
 			} else if (tempTask.getType() == "selection") {
-				System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType());
+				//System.out.println("Adding SelectionInstance " + parent.get(startIndex) + " to " + tempTask.getType());
 				ISelectionInstance selection = taskFactory.createNewTaskInstance((ISelection) tempTask);
 				taskBuilder.setChild(selection, parent.get(startIndex) );
@@ -149,5 +149,5 @@
 
 			} else if (tempTask.getType() == "sequence") {
-				System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType());
+				//System.out.println("Adding SequenceInstance " + parent.get(startIndex) + " to " + tempTask.getType());
 				//TODO: Implement this
 				throw new NotImplementedException();
@@ -155,8 +155,8 @@
 			} else if (tempTask.getType() == "iteration") {
 				//TODO: Implement this
-				System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType());
+				//System.out.println("Adding IterationInstance " + parent.get(startIndex) + " to " + tempTask.getType());
 				throw new NotImplementedException();
 			} else {
-				System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType());
+				//System.out.println("Adding EventInstance " + parent.get(startIndex) + " to " + tempTask.getType());
 				taskBuilder.addChild(subsequence, parent.get(startIndex));
 			}
@@ -170,6 +170,6 @@
 			System.out.println(it.next());
 		}*/
-		System.out.println();
-		System.out.println();
+		//System.out.println();
+		//System.out.println();
 		
 		taskBuilder.addTaskInstance(parent, startIndex, subsequence);
Index: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java
===================================================================
--- branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java	(revision 1664)
+++ branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleAlignment.java	(revision 1666)
@@ -198,6 +198,4 @@
 						.getNumberSequences().get(j).containsPattern(pattern);
 				if (startpositions.size() > 0) {
-					NumberSequence tempns = appData.getNumberSequences().get(j);
-
 					for (Iterator<Integer> jt = startpositions.iterator(); jt
 							.hasNext();) {
@@ -234,4 +232,5 @@
 						.get(i).getOccurences().iterator(); it.hasNext();) {
 					MatchOccurence oc = it.next();
+					/*
 					System.out.println("Trying to replace sequence: ");
 					matchseqs.get(i).getFirstSequence().printSequence();
@@ -244,10 +243,11 @@
 							+ oc.getEndindex());
 					System.out.println();
-
+					*/
+					
 					// System.out.println("Printing session: ");
-					for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) {
-						System.out.println(j + ": "
-								+ sessions.get(oc.getSequenceId()).get(j));
-					}
+					//for (int j = 0; j < sessions.get(oc.getSequenceId()).size(); j++) {
+					//	System.out.println(j + ": "
+					//			+ sessions.get(oc.getSequenceId()).get(j));
+					//}
 
 					// Check if nothing has been replaced in the sequence we
@@ -272,5 +272,4 @@
 							
 							if (oc.getStartindex() >= tmpOC.getStartindex() && oc.getStartindex()<=tmpOC.getEndindex()) {
-								System.out.println("This position has already been replaced in this iteration");
 								continue invalidOccurence;
 							}
@@ -284,12 +283,6 @@
 								// Just to be sure.
 								if (diff > 0) {
-									System.out.println("Old index: Start: "
-											+ oc.getStartindex() + " End "
-											+ oc.getEndindex());
 									oc.setStartindex(oc.getStartindex() - diff+1);
 									oc.setEndindex(oc.getEndindex() - diff+1);
-									System.out.println("Updated index: Start: "
-											+ oc.getStartindex() + " End "
-											+ oc.getEndindex());
 								} else {
 									Console.traceln(Level.WARNING,
@@ -346,44 +339,5 @@
 	}
 
-	// check if we have any replaced occurence with indexes
-	// smaller than ours. If so, we need to adjust our start
-	// and endpoints
-	// of the replacement.
-	// Also do a check if we have replaced this specific
-	// MatchOccurence in this sequence already. Jump to the
-	// next occurence if this is the case.
-	private void updateMatchIndexes(List<Match> matchseqs, int sequenceId,
-			int startindex, int endindex) {
-
-		for (int i = 0; i < matchseqs.size(); i++) {
-			for (Iterator<MatchOccurence> it = matchseqs.get(i).getOccurences()
-					.iterator(); it.hasNext();) {
-				MatchOccurence tmpOC = it.next();
-				// if the matchoccurence starts in a sequence that has been
-				// replaced right now we delete it
-				if (tmpOC.getStartindex() > startindex
-						&& tmpOC.getStartindex() < endindex) {
-					it.remove();
-				} else if (tmpOC.getStartindex() > endindex) {
-					int diff =  endindex-startindex;
-					// Just to be sure.
-					if (diff > 0) {
-						System.out.println("Old index: Start: "
-								+ tmpOC.getStartindex() + " End "
-								+ tmpOC.getEndindex());
-						tmpOC.setStartindex(tmpOC.getStartindex() - diff + 1);
-						tmpOC.setEndindex(tmpOC.getEndindex() - diff + 1);
-						System.out.println("Updated index: Start: "
-								+ tmpOC.getStartindex() + " End "
-								+ tmpOC.getEndindex());
-					} else {
-						Console.traceln(Level.WARNING,
-								"End index of a Match before start. This should never happen");
-					}
-				}
-			}
-		}
-	}
-
+	
 	/**
 	 * <p>
