functions for Randomized queue added