Completed problem 5 in Haskell