removing warnings.
adding doctest.