added linear fitting for numerics