Sort command functional, but still reliant on swapping