Add function to return total nodes.