implementing a function for print service