Implemented randomized operations on the queue in threads