Improved finding the range of the fitting