added a more portable print method