implemented deletion of nodes