link and node code modified for redraw