Changed to a two flag system. Need to remove and check for empty stack.