changed handling of statistic calculations