implemented stack and queue