completed inner class version of singly linked list