delete and insert for linked list