def remove_duplicates(n):
    """ Removes duplicates in a given list (referenced list)
        Returns a list of all duplicates.
    """

    seen = []
    duplicates = []

    # determine duplicates
    for x in n:
        if x in seen:
            duplicates.append(x)
        else:
            seen.append(x)

    # modify list in-place by assiining to its slice
    n[:] = seen; 

    # return duplicates
    return duplicates