Changes to sorting methods