write some haddock documentation