sort pieces before starting