fix bugs in edge orientation.  add code to extend nodes.  add edge length stats to output