Given a string to search for, I want to write a recursive function that takes in only one parameter (The string to search for). The function will search for the value recursively and if it is found then it will remove the item and return it. If it is not found then, the function will reach the end of the list and return null. What I have so far I think is the right idea except it is not functioning properly:

**Main Test Class**

```
public static void main(String[] args) {
    RecLinkedList list = new RecLinkedList();
    list.add("A");
    list.add("B");
    list.add("D");
    list.add("C", 2);
    list.add("E", 4);
    list.add("G", 6); //this should be invalid

    System.out.println( list );
    System.out.println( list.remove( 1 ).getValue() );
    System.out.println( list.remove("D").getValue() );
    System.out.println( list.remove("G").getValue() );
    System.out.println( list.size() );
    System.out.println( list );
}

```

**Linked List Class (Showing only what I need help on)**

```
public class RecLinkedList {
private Node first;
private int size = 0;

public RecLinkedList(){
    first = null;
}
public boolean isEmpty() {
    return first == null;
}
public Node remove( String s ){
    return remove( s, 0, first );
}
private Node remove( String s, int count, Node list ){
    if( list == null ){
        return null;
    }else if( s.equals(s) ){
        first = list.getNext();
        return list;
    }else if( s.equals(count+1) ){
        Node n = list.getNext();
        if( list.getNext() != null ){
            list.setNext( list.getNext().getNext() );
        }
        return n;
    }else{
        return remove( s, count+1, list.getNext() );
    }
}

```

So far, I am able to remove the item but as of now the item "A" is getting removed when it should not be. The final list should be A,C,E. (G should return and print null because it does not exist). I think I am close, but off by something minor, but I can not seem to figure it out.