Updated circular queue code.