Ah, never mind, I see that you're merging in one element at a time, where `a` is a queue and `b` is an element. You should give these functions and parameters better names. Maybe call this `merge(queue, element)`.