prepare for stack and queue