finished draft of random queue and subset