store number of samples in each variable in global data
issue #8: attempt to refine the precision since the cumulative error is way too big