// remove first node from List
        public object RemoveFromFront()
        {
            if (IsEmpty())
            {
                throw new EmptyListException(name);
            }

            object removeItem = firstNode.Data; // retrieve data

            // reset firstNode and lastNode references
            if (firstNode == lastNode)
            {
                firstNode = lastNode = null;
            }
            else
            {
                firstNode = firstNode.Next;
            }

            return(removeItem); // return removed data
        }
        // output List contents
        public void Display()
        {
            if (IsEmpty())
            {
                Console.WriteLine($"Empty {name}");
            }
            else
            {
                Console.Write($"The {name} is: ");

                ListNode current = firstNode;

                // output current node data while not at end of list
                while (current != null)
                {
                    Console.Write($"{current.Data} ");
                    current = current.Next;
                }

                Console.WriteLine("\n");
            }
        }
        private string name; // string like "list" to display

        // construct empty List with specified name
        public List(string listName)
        {
            name      = listName;
            firstNode = lastNode = null;
        }
 // constructor to create ListNode that refers to dataValue
 // and refers to next ListNode in List
 public ListNode(double dataValue, ListNode nextNode)
 {
     Data = dataValue;
     Next = nextNode;
 }