rewritten destroy_machine method to delete node object