def fill_empties(abstract):
    """Fill empty cells in the abstraction

    The way the row patterns are constructed assumes that empty cells are 
    marked by the letter `C` as well. This function fill those in. The function 
    also removes duplicate occurrances of ``CC`` and replaces these  with 
    ``C``.

    Parameters
    ----------
    abstract : str
        The abstract representation of the file.

    Returns
    -------
    abstraction : str
        The abstract representation with empties filled.


    """
    while 'DD' in abstract:
        abstract = abstract.replace('DD', 'DCD')
    while 'DR' in abstract:
        abstract = abstract.replace('DR', 'DCR')
    while 'RD' in abstract:
        abstract = abstract.replace('RD', 'RCD')
    while 'CC' in abstract:
        abstract = abstract.replace('CC', 'C')
    if abstract.startswith('D'):
        abstract = 'C' + abstract
    if abstract.endswith('D'):
        abstract += 'C'
    return abstract
