Simplified Haskell code
Simplified Haskell code