An adaptive moving total least squares method for curve fitting