def max_index(alignment_matrix):
    """
    Helper function that computes the index of the maximum in the
    alignment matrix.
    """
    max_i = 0
    max_j = 0
    for idx_i in range(len(alignment_matrix)):
        for idx_j in range(len(alignment_matrix[0])):
            if alignment_matrix[idx_i][idx_j] > alignment_matrix[max_i][max_j]:
                max_i = idx_i
                max_j = idx_j

    return max_i, max_j