Pancake sorting