fixed problem with modifying an unmodifiable list
added code to record the inverse path for bi-directional connections.