adding closest pair