a few more changes to the sorter