fix minor bug in sorting of Z1