small changes to pathlength calculation

pathlength calculation - unfinished