Got rid of the bad sorting