Queuing logic