Added partitioning to improve reduce performenace