Adding a function to return the reordered nodeid