private MapAlignment backtrace(RingSeries a, RingSeries b) {
		TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>();

		int maxScore = Integer.MIN_VALUE;
		int adex = -1;
		int bdex = -1;
		for(int ii = 0; ii < a.length(); ii++){
//			if(the_scorer instanceof PearsonCorrelationScorer){
//				if(score_matrix[ii][b.length()-1]/path_length[ii][b.length()-1] > maxScore){
//					maxScore = score_matrix[ii][b.length()-1]/path_length[ii][b.length()-1];
//					adex = ii;
//					bdex = b.length()-1;
//				}
//			}
//			else{
				if(score_matrix[ii][b.length()-1] > maxScore){
					maxScore = score_matrix[ii][b.length()-1];
					adex = ii;
					bdex = b.length()-1;
				}
//			}
		}
		for(int ii = 0; ii < b.length(); ii++){
//			if(the_scorer instanceof PearsonCorrelationScorer){
//				if(score_matrix[a.length()-1][ii]/path_length[a.length()-1][ii] > maxScore){
//					maxScore = score_matrix[a.length()-1][ii]/path_length[a.length()-1][ii];
//					adex = a.length()-1;
//					bdex = ii;
//				}
//			}
//			else{
				if(score_matrix[a.length()-1][ii] > maxScore){
					maxScore = score_matrix[a.length()-1][ii];
					adex = a.length()-1;
					bdex = ii;
				}
//			}
		}
		System.out.println("best backtrace starts at "+adex+","+bdex+" with a score of "+maxScore);
		while(adex >= 0 && bdex >= 0){
			map.put(adex, bdex);
			int ladex = adex;
			adex = backtrace_a[adex][bdex];
			bdex = backtrace_b[ladex][bdex];
		}

		MapAlignment toReturn = new MapAlignment(map,maxScore);
		return toReturn;
	}