Updated print to return the printed string