Added doctest and haddock