Made some minor changes to program messages
Refactored main.cc