public class SingleLinkedList {

    private Node list;

    public SingleLinkedList() {
        list = null;
    }

    public void addNode(Score s) {
        Node newNode = new Node(s);
        Node current = list;
        if (list == null){
            list = newNode;
        }
        else if (newNode.data.getScore() >= current.data.getScore()){
            list = newNode;
            newNode.next = current;
            if (countNodes(list) > 10) {
                removeLastNode();
            }
        }
        else {
            while (current.next != null && newNode.data.getScore() <= current.next.data.getScore()){
                current = current.next;
            }
            if (current.next == null) {
                if (countNodes(list) < 10) {
                    current.next = newNode;
                    System.out.println("List less than 10.");
                }
            }
            else {
                newNode.next = current.next;
                current.next = newNode;
                if (countNodes(list) > 10) {
                    removeLastNode();
                }
            }
        }
    }

    private Node findNode(Score s) {
        Node current = list;
        if (list == null) {
            return list;
        }
        else {
            while (current.data.getScore() != s.getScore()) {
                current = current.next;
            }
            return current;
        }
    }

    public void removeNode(Node n) {
        Node current = list;
        Node previous = list;
        while (n != current) {
            previous = current;
            current = current.next;
        }
        if (current != null) previous.next = current.next;

    }

    public void removeLastNode() {
        Node current = list;
        Node previous = list;
        while (current.next != null) {
            previous = current;
            current = current.next;
        }
        previous.next = null;
    }
    public void addFront(Score s){
        Node frontNode = new Node(s);
        frontNode.next = list;
        list = frontNode;
    }

    public void addTail(Score s) {
        Node tailNode = new Node(s);
        Node current = list;
        if (list == null){
            list = tailNode;
        }else{
            while (current.next != null){
                current = current.next;
            }
            current.next = tailNode;
        }
    }


    public Score topScore(){
        Node current = list.next;
        Score bestStudent = list.data;
        while (current != null){
            if (current.data.getScore() > bestStudent.getScore()){
                bestStudent = current.data;
            }
            current = current.next;
        }
        return bestStudent;
    }

    public void printLinkedList(){
        Node current = list;
        int count = 1;
        while (current != null){
            System.out.println(count + ": " + current.data.getScore());
            current = current.next;
            count++;
        }
    }

    public int countNodes(Node list){
        if (list.next == null) {
            return 1;
        }else{
            return countNodes(list.next) + 1;
        }
    }

    public Score worstStudentRec(Node list){
        if (list.next == null){
            return list.data;
        }else{
            Score s = worstStudentRec(list.next);
            if (s.getScore() < list.data.getScore()){
                return s;
            }else{
                return list.data;
            }
        }
    }



    public Node getList(){
        return list;
    }

    private class Node{

        public Score data;
        private Node next;

        public Node(Score s){
            data = s;
            next = null;
        }
    }
}
@@ -1146,1619 +1146,242 @@
    p
-rivate Node findNode(Score s) %7B%0A        Node current = list;%0A        if (list == null) %7B%0A            return list;%0A        %7D%0A        else %7B%0A            while (current.data.getScore() != s.getScore()) %7B%0A                current = current.next;%0A            %7D%0A            return current;%0A        %7D%0A    %7D%0A%0A    public void removeNode(Node n) %7B%0A        Node current = list;%0A        Node previous = list;%0A        while (n != current) %7B%0A            previous = current;%0A            current = current.next;%0A        %7D%0A        if (current != null) previous.next = current.next;%0A%0A    %7D%0A%0A    public void removeLastNode() %7B%0A        Node current = list;%0A        Node previous = list;%0A        while (current.next != null) %7B%0A            previous = current;%0A            current = current.next;%0A        %7D%0A        previous.next = null;%0A    %7D%0A    public void addFront(Score s)%7B%0A        Node frontNode = new Node(s);%0A        frontNode.next = list;%0A        list = frontNode;%0A    %7D%0A%0A    public void addTail(Score s) %7B%0A        Node tailNode = new Node(s);%0A        Node current = list;%0A        if (list == null)%7B%0A            list = tailNode;%0A        %7Delse%7B%0A            while (current.next != null)%7B%0A                current = current.next;%0A            %7D%0A            current.next = tailNode;%0A        %7D%0A    %7D%0A%0A%0A    public Score topScore()%7B%0A        Node current = list.next;%0A        Score bestStudent = list.data;%0A        while (current != null)%7B%0A            if (current.data.getScore() %3E bestStudent.getScore())%7B%0A                bestStudent = current.data;%0A            %7D%0A            current = current.next;%0A        %7D%0A        return bestStudent
+ublic void removeLastNode() %7B%0A        Node current = list;%0A        Node previous = list;%0A        while (current.next != null) %7B%0A            previous = current;%0A            current = current.next;%0A        %7D%0A        previous.next = null
 ;%0A  
@@ -1826,401 +1826,8 @@
  %7D%0A%0A
-    public Score worstStudentRec(Node list)%7B%0A        if (list.next == null)%7B%0A            return list.data;%0A        %7Delse%7B%0A            Score s = worstStudentRec(list.next);%0A            if (s.getScore() %3C list.data.getScore())%7B%0A                return s;%0A            %7Delse%7B%0A                return list.data;%0A            %7D%0A        %7D%0A    %7D%0A%0A%0A%0A    public Node getList()%7B%0A        return list;%0A    %7D%0A%0A
     

Remove unused methods