track length calculation. not tested yet