Passes tests.
Modified doctest a bit.