implemented statistic function