Added printMessage() method