attempt at haskell answers.