Made copy function in tree and all nodes