def cigar_join(initial, value, wasinsert):
    """ adds a value to a list
    
    Args:
        initial: list to be added to
        value: data point to be added. This is either a string or an integer
        wasinsert: whether the previous position contained an insertion
    
    Returns:
        list with value added appropriately
    """
    if not wasinsert:
        initial.append(value)
        return initial
    try:
        initial[-1] += value
    except TypeError:
        initial[-1].append(value)
    return initial
