heap and flip pancake