Improved implementation of RandomizedQueue
Reverted to best found solution