Implemented the queue processing.