used copy constructor for nodes