def move_unassigned_reads_to_unmapped(unassigned_contigs, mapped_reads_dict, unmapped_reads):
    """
    Given the unassigned contigs, moves their reads from mapped_reads_dict and
    appends them to unmapped_reads. Then deletes them from mapped_reads_dict.
    """
    # Make copies of the input
    mapped_reads_dict = mapped_reads_dict.copy()
    unmapped_reads = unmapped_reads.copy()

    for contig in unassigned_contigs:

        # Add to unmapped reads
        unmapped_reads.extend(mapped_reads_dict[contig])

        # Remove from mapped reads dictionary
        del mapped_reads_dict[contig]

    return mapped_reads_dict, unmapped_reads