Implementing very simple path shortening