added some documentation using haddock