Order of operations fixed.
Duplicate code eliminated.
All messages processed.