Improved statisticsString function in TSCollectionwq