Made changes, and included a comment by the professor on top
Small changes for global rules, refactored two for loops to methods, refactored a repeated code in a function to create_message