Made message-analyzer.py more efficient