Use best fit theat instead of the theat of last iterator. Fix tests.