Make the stack pattern support going up or down