Added delete function to the node class