added nested partitioning