Implement delete function on linked list