Added path length computation.
Added path length computation.