Added stats calculations.