Changed queues to pointers