def remove_dups(linked_list):
    """Remove duplicate values from a linked list

    Uses a hash table to store values previously found, and walks through
    linked list, deleting duplicates vals.

    Parameters
    ----------
    linked_list : LinkedList
        Linked list to remove duplicates from

    Returns
    -------
    linked_list : LinkedList
        Input linked list, with duplicates removed
    """
    # Handle empty linked list
    if linked_list.head is None:
        return linked_list

    # Initialise hash table to contain values found
    vals_found = {}

    # Start at head
    current_node = linked_list.head
    # Add head val to vals_found
    vals_found[current_node.data] = True

    # Walk through linked list, from head to tail
    while current_node.next_node is not None:
        # Check next node's value, to see if it is a duplicate
        next_node = current_node.next_node
        if next_node.data in vals_found:
            # Delete next node
            current_node.next_node = next_node.next_node
            # Stick to current_node, don't update it, since its next_node has
            # changed
        else:
            # Add val to vals_found
            vals_found[next_node.data] = True
            # Go to next node
            current_node = next_node

    return linked_list