Minor: updated shorten path algorithm.