first draft of minDifference()