3d Closest Pair Algorithm