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 1573)
+++ /branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java	(revision 1574)
@@ -63,4 +63,5 @@
 
 		buildMatrix();
+		traceback();
 	}
 
@@ -216,16 +217,10 @@
 	
 	
-	private int[] traceback(int i, int j) {
-		
-			
-		return null;
-	}
-	
-	
 	public void traceback() {
 		MatrixEntry tmp = matrix[length1+1][0];
-		
-		int aligned1[] = new int[length1+length2];
-		int aligned2[] = new int[length1+length2];
+		//TODO: Why do we need such long arrays, also, add a check if we reach the limit?
+		int aligned1[] = new int[2*length1+2*length2];
+		int aligned2[] = new int[2*length1+2*length2];
+		System.out.println("Aligned length: " + aligned1.length);
 		int count = 0;
 		do
@@ -239,4 +234,5 @@
 			tmp = tmp.getPrevious();
 			count++;
+			System.out.println(count);
 			
 		} while(tmp != null);
@@ -246,6 +242,8 @@
 		int reversed2[] = new int[count];
 		
-		for(int i = count; count > 0; count ++) {
-			
+		
+		for(int i = count-1; i > 0; i--) {
+			reversed1[reversed1.length-i]= aligned1[i];
+			reversed2[reversed2.length-i]= aligned2[i];
 		}
 		
@@ -328,38 +326,4 @@
 	}
 
-	/**
-	 * Return a set of Matches identified in Dynamic programming matrix. A match
-	 * is a pair of subsequences whose score is higher than the preset
-	 * scoreThreshold
-	 **/
-	public List<Match> getMatches() {
-		ArrayList<Match> matchList = new ArrayList();
-		int fA = 0, fB = 0;
-		// skip the first row and column, find the next maxScore after
-		// prevmaxScore
-		for (int i = 1; i <= length1; i++) {
-			for (int j = 1; j <= length2; j++) {
-				if (matrix[i][j].getScore() > scoreThreshold
-						&& matrix[i][j].getScore() > matrix[i - 1][j - 1].getScore()
-						&& matrix[i][j].getScore() > matrix[i - 1][j].getScore()
-						&& matrix[i][j].getScore() > matrix[i][j - 1].getScore()) {
-					if (i == length1 || j == length2
-							|| matrix[i][j].getScore() > matrix[i + 1][j + 1].getScore()) {
-						// should be lesser than prev maxScore
-						fA = i;
-						fB = j;
-						int[] f = traceback(fA, fB); // sets the x, y to
-														// startAlignment
-														// coordinates
-						System.out.println(f[0] + " " + i + " " + f[1] + " "
-								+ j + " " + matrix[i][j].getScore());
-						// TODO Add matches to matchList
-					}
-				}
-			}
-		}
-		return matchList;
-	}
-	
 
 	public List<NumberSequence> getAlignment() {
