method to print to string, quick test in main