Moved SumSquareDifference from util, should have been in ref.