Added a sort pieces command