basic statistic collection from traces (corrected...)