updated snippets, improved haskell code.