added functionality for adding nodes at intersections. Currently broken