implement stack and queue