Simplified swap in queue.c