queues now with sorting