added path length calculator