Write doctest