added copyNode function to nodes file