Implemented Printing Messages

Made code more readable. I also made the file compile with older
compilers.  Still not working with test-ok script.