Tweaked displayMessage method to remove unnecessary whitespace