Works with my own implementation of stack and queue with linked lists. Made my queue and stacks global.