added within ftol function