Adding  global stats calculations.