Don't use global var for the total nodes counter