updated print method