Simplified the partition method