Added sorting so that the plots look nice