fix fit-algorithm implementation: min compare