Optimization to calculating return path.