Updated backend

now keeps track of total nodes