public static NwCell[][] getMatrix( ProbSequence seq1, ProbSequence seq2   ) throws Exception
	{
		NwCell[][] matrix  = new NwCell[seq2.getColumns().size() + 1][seq1.getColumns().size() + 1  ];
		
		matrix[0][0] = new NwCell(0, NwCell.Direction.INIT);
		
		for (int x=1; x <= seq1.getColumns().size(); x++)
			matrix[0][x] = new NwCell( 0, NwCell.Direction.LEFT );
		
		for (int x=1; x <= seq2.getColumns().size(); x++)
			matrix[x][0] = new NwCell( 0, NwCell.Direction.UP);
		
		for( int y=1; y <= seq1.getColumns().size(); y++)
		{
			ProbColumn seq1Col = seq1.getColumns().get(y-1);
			
			for( int x=1; x <= seq2.getColumns().size(); x++)
			{
				ProbColumn seq2Col = seq2.getColumns().get(x-1);
				
				double diagScore = seq1Col.getScoreDiag(seq2Col, MATCH_REWARD, MISMATCH_PENALTY, GAP_PENALTY) + 
							matrix[x-1][y-1].getScore()	;
				
				double upScore = matrix[x-1][y].getScore() + GAP_PENALTY;
				double leftScore = matrix[x][y-1].getScore() + GAP_PENALTY;
				
				double max = Math.max(diagScore, upScore);
				max = Math.max(max, leftScore);
				
				if( max == diagScore)
				{
					matrix[x][y] = new NwCell( diagScore, NwCell.Direction.DIAGNOL );
				}
				else if ( max == leftScore)
				{
					matrix[x][y] = new NwCell( leftScore, NwCell.Direction.LEFT);
				}
				else if ( max == upScore)
				{
					matrix[x][y] = new NwCell(upScore, NwCell.Direction.UP);
				}
				else throw new Exception(x + " " + y + " " + seq1.toString() + " " + seq2.toString() + " " +  "Logic error " + max + " " + diagScore + " " + leftScore + "  " + upScore + " " + seq1Col + "  " + seq2Col);
				
			}
		}
		
		return matrix;
	}