delete linked list function and test