Implemented custom partitioning