documentation for closestPartition