Use FIFO queue instead of stack for active pairs