Update msg.pl

Cleaning up and commenting