The goal is to create a copy of a tree, where each node has a value that is double the value of the original node. The function should be implemented recursively. I have written some code which creates a new tree but the error is that my code never creates a "full copy", its always only the first two levels.

```
Node* doubleUp(Node* root) {
int value = root->data;
Node* newroot = new Node(value*2);

if(root->left != NULL)
{
    int value = (root->left)->data;
    Node* left = new Node(value*2);
    newroot->left = left;
    doubleUp(newroot->left);
}
if(root->right != NULL)
{
    int value = (root->right)->data;
    Node* right = new Node(value*2);
    newroot->right = right;
    doubleUp(newroot->right);
}
return newroot;
}

```

I understand why its doing this, the function always creates a "newroot", when instead after the first level it should be just taking the parameter passed to it. But not sure what to do to fix it.

Here is a sample tree, using the Node struct.

```
Node a(0), b(4), c(2), d(1), e(5), f(6), g(3), h(7);
a.left=&b;
a.right=&c;
c.left=&f;
b.left=&d;
b.right=&e;
d.left=&g;
d.right=&h;

```