Fixed most errors
Added Haddock docs, no comments though
Added haddock comments