Program to append one node to another