cherry: split off function to print output lines