Linked list deletions and moved testing outside the class