sorting for gb-queues

Added an enhancement and realization to sort globally bounded queues.