Update stack-and-queue