Added a generic print function to base class