Implementing the path length calculation in LSL and RSR paths