Refactored compactParSort