added nodeCopy() function