def Initialise(Pathway_row, Pathway_column, Gap, Rank):
    """Initialise the scoring matrix for Modified Needleman-Wunsch Algorithm."""
    # Create empty matrix
    matrix = [[0 for c in range(len(Pathway_column))] for r in range(len(Pathway_row))]

    # Initialise frist row and column with r*gap value
    for r, code_r in enumerate(Pathway_row[1:]):
        matrix[r+1][0] = matrix[r][0] + Gap + Rank[code_r]
    for c, code_c in enumerate(Pathway_column[1:]):
        matrix[0][c+1] = matrix[0][c] + Gap + Rank[code_c]

    return matrix