adds basic logic for queues