Added support to calculate statistics and show them in GUI