start work on stat_calc()