Changes to sorting algorithms