Added a print method to the class.