Implemented the randomized queue and the subset