Some basic change, mostly in the statistics function