removing nodes from the end of linked list