first haskell solution