added statisticsFunction