Working through code jam in haskell.