added parsing and generating statistics to stdout output