Implemented randomized queue.