Index: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithm.java
===================================================================
--- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithm.java	(revision 1589)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithm.java	(revision 1592)
@@ -16,3 +16,5 @@
 	public abstract void printAlignment();
 
+	public abstract ArrayList<ArrayList<NumberSequence>> getMatches();
+
 }
Index: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NeedlemanWunsch.java
===================================================================
--- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NeedlemanWunsch.java	(revision 1589)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NeedlemanWunsch.java	(revision 1592)
@@ -283,4 +283,10 @@
 	}
 
+	@Override
+	public ArrayList<ArrayList<NumberSequence>> getMatches() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 
 
Index: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequence.java
===================================================================
--- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequence.java	(revision 1589)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/NumberSequence.java	(revision 1592)
@@ -49,3 +49,6 @@
 	}
 
+	public int size() {
+		return sequence.length;
+	}
 }
Index: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWaterman.java
===================================================================
--- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWaterman.java	(revision 1589)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWaterman.java	(revision 1592)
@@ -288,3 +288,9 @@
 	}
 
+	@Override
+	public ArrayList<ArrayList<NumberSequence>> getMatches() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 }
Index: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java
===================================================================
--- branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java	(revision 1589)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java	(revision 1592)
@@ -93,4 +93,6 @@
 		matrix[0][0].setScore(0);
 		matrix[0][0].setPrevious(null); // starting point
+		matrix[0][0].setXvalue(Constants.UNMATCHED_SYMBOL);
+		matrix[0][0].setYvalue(Constants.UNMATCHED_SYMBOL);
 
 		// the first column
@@ -132,5 +134,5 @@
 			tempMax -= scoreThreshold;
 			matrix[i][0].setScore(Math.max(firstRowLeftScore, tempMax));
-			if(tempMax ==matrix[i][0].getScore()){
+			if(tempMax == matrix[i][0].getScore()){
 				matrix[i][0].setPrevious(matrix[i-1][maxRowIndex]);
 			}
@@ -222,5 +224,5 @@
 		LinkedList<Integer> aligned1 = new LinkedList<Integer>();
 		LinkedList<Integer> aligned2 = new LinkedList<Integer>();
-		do {
+		while (tmp.getPrevious() != null) {
 			
 			aligned1.add(new Integer(tmp.getXvalue()));
@@ -228,6 +230,5 @@
 
 			tmp = tmp.getPrevious();
-
-		} while (tmp != null);
+		} 
 		
 		// reverse order of the alignment
@@ -296,10 +297,52 @@
 			count++;
 			
-		} while(tmp != null);
+		} while(tmp.getPrevious() != null);
 		System.out.println(aligned1);
 		System.out.println(aligned2);
 	}
 	
-
+	public ArrayList<ArrayList<NumberSequence>> getMatches() {
+		ArrayList<ArrayList<NumberSequence>> result = new ArrayList<ArrayList<NumberSequence>>();
+		
+		//both alignment sequences should be equally long
+		int i = 0;
+		int[] seq1 = alignment.get(0).getSequence();
+		int[] seq2 = alignment.get(1).getSequence();
+		int start = 0;
+		while (i < seq1.length){
+			if(seq2[i] != Constants.UNMATCHED_SYMBOL) {
+				start = i;
+				int count = 0;
+				while(i < seq2.length && seq2[i] != Constants.UNMATCHED_SYMBOL) {
+					i++;
+					count++;
+				}
+				//I am really missing memcpy here 
+				int[] tmp1 = new int[count];
+				int[] tmp2 = new int[count];
+				for (int j = 0; j<count;j++) {
+					tmp1[j] = seq1[start+j];
+					tmp2[j] = seq2[start+j];
+				}
+				NumberSequence tmpns1 = new NumberSequence(count);
+				NumberSequence tmpns2 = new NumberSequence(count);
+				tmpns1.setSequence(tmp1);
+				tmpns2.setSequence(tmp2);
+				ArrayList<NumberSequence> tmpal = new ArrayList<NumberSequence>();
+				tmpal.add(tmpns1);
+				tmpal.add(tmpns2);
+				result.add(tmpal);
+			}
+			i++;
+		}
+		
+		
+		
+		
+		
+		
+		return result;
+		
+	}
 	
 	/**
