def encode_old(oracle):
    """ 
    return code and compror for a given Oracle representation
    """
    compror = []
    if type(oracle) == dict:
        lrs = oracle['lrs']
        sfx = oracle['sfx']
    else:
        lrs = oracle.lrs
        sfx = oracle.sfx
    code = []
    j = 0
    i = j
    cnt = 1
    while j < len(lrs):
        while i < len(lrs) - 1 and lrs[i + 1] >= i - j + 1:
            i = i + 1
        if i == j:
            i = i + 1
            code.append((0, i))
        else:
            code.append((i - j, sfx[i] - i + j + 1))
            compror.append(i)
        cnt = cnt + 1
        j = i
    return code, compror
