added statistic and csv output modes