Add efficient queue implementation.