define print_to_stream explicitly, reorder examples