finished minDiff() !!!!!!!!!!