adding doc for do_print(). added unit test.