Reordered the statistics routines and repaired interpolation errors
Fixed bugs in the interpolation in stats