Improved readability on problem 4 (Haskell)