partitioner code