Haskell version working