empty stack optimization