chapter12: doctest