deleted dead nodes from nodes[] to avoid doubles