Added implementation in Haskell.
Code clean up.