Update with latest sd_sorting code