add closest pair implementation