correct the different sorting stuff