First version with queues