finishing closest pair problem and profiling the code