Stats recalculation (ready)

Recalculate stats when the data state changes.