Implements second revision of the message queue.