develope printMessage() function