Move getting track length into a function, to remove in the future accessing data directly from the vts and vmg