checking in doubly linked lists implementation