Statistics: minor reordering (no code change)
Fitting: faster algorithm for fitting to a line