finish stacks and queues