stack and queue working