add haddock comment for encoding