closed #47 added statistic code