fix doctest and add note about result keyword