Added some code for the print function.