More changes to tsGroups to handle distances.