reviving the Haskell port