Adding a few improvements to the initial version:
- adding a cleaner version of generateMessage
- debug mode to message generation