added implementation for queues