adding closestPairs problem solve