Add back in check which makes sure there is at least one intermediate point between source and target nodes