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 1595)
+++ branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/SmithWatermanRepeated.java	(revision 1596)
@@ -221,5 +221,5 @@
 
 	public void traceback() {
-		MatrixEntry tmp = matrix[length1+1][0];
+		MatrixEntry tmp = matrix[length1+1][0].getPrevious();
 		LinkedList<Integer> aligned1 = new LinkedList<Integer>();
 		LinkedList<Integer> aligned2 = new LinkedList<Integer>();
@@ -237,5 +237,5 @@
 
 		int count = 0;
-		for (Iterator<Integer> it = aligned1.descendingIterator(); it.hasNext();) {
+		for (Iterator<Integer> it = aligned1.iterator(); it.hasNext();) {
 			count++;
 			reversed1[reversed1.length - count] = it.next();
@@ -243,5 +243,5 @@
 		}
 		count = 0;
-		for (Iterator<Integer> it = aligned2.descendingIterator(); it.hasNext();) {
+		for (Iterator<Integer> it = aligned2.iterator(); it.hasNext();) {
 			count++;
 			reversed2[reversed2.length - count] = it.next();
@@ -260,44 +260,35 @@
 	
 	public void printAlignment() {
-		MatrixEntry tmp = matrix[length1+1][0];
-		String aligned1 = "";
-		String aligned2 = "";
-		int count = 0;
-		do
-		{
-			String append1="";
-			String append2="";
-					
-			if(tmp.getXvalue() == Constants.GAP_SYMBOL) {
-				append1 = "  ___";
-			}
-			else if(tmp.getXvalue() == Constants.UNMATCHED_SYMBOL) {
-				append1 = "  ...";
+		int[] tmp1 = alignment.get(0).getSequence();
+		int[] tmp2 = alignment.get(1).getSequence();
+		for (int i=0; i< tmp1.length;i++) {
+			if(tmp1[i] == Constants.GAP_SYMBOL) {
+				System.out.print("  ___");
+			}
+			else if(tmp1[i] == Constants.UNMATCHED_SYMBOL) {
+				System.out.print("  ...");
 			}
 			else {
-				append1 = String.format("%5d", tmp.getXvalue());
-			}
-
-			if(tmp.getYvalue() == Constants.GAP_SYMBOL) {
-				append2 = "  ___";
-			}
-			else if(tmp.getYvalue() == Constants.UNMATCHED_SYMBOL) {
-				append2 = "  ...";
+				System.out.format("%5d", tmp1[i]);
+			}
+			
+		}
+		System.out.println();
+		for (int i=0; i< tmp2.length;i++) {
+			if(tmp2[i] == Constants.GAP_SYMBOL) {
+				System.out.print("  ___");
+			}
+			else if(tmp2[i] == Constants.UNMATCHED_SYMBOL) {
+				System.out.print("  ...");
 			}
 			else {
-				append2 = String.format("%5d", tmp.getYvalue());
-			}
-			if(count != 0)
-			{
-				aligned1 = append1 + aligned1;
-				aligned2 = append2 + aligned2;
-			}
-			
-			tmp = tmp.getPrevious();
-			count++;
-			
-		} while(tmp.getPrevious() != null);
-		System.out.println(aligned1);
-		System.out.println(aligned2);
+				System.out.format("%5d", tmp2[i]);
+			}
+			
+		}
+		System.out.println();
+		
+		
+	
 	}
 	
