Added node count method to return the number of nodes in the list.