Added print method to task class