Added elementary queue-handling functions